Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

persistent session do not receive missed messages #3202

Open
Corentin-Luc-Artaud opened this issue Jan 14, 2025 · 0 comments
Open

persistent session do not receive missed messages #3202

Corentin-Luc-Artaud opened this issue Jan 14, 2025 · 0 comments
Labels
Status: Available No one has claimed responsibility for resolving this issue.

Comments

@Corentin-Luc-Artaud
Copy link

It seems that missed messages are not forwarded to persistent sessions on reconnect, using mosquitto_sub with options -c and -i sets with a Qos of 2 and messages published with a Qos of 2 or 1.

I have seen this behavior with mosquitto 2.0.15 and 2.0.20 in docker
with the following configuration.

per_listener_settings true

listener 1883
allow_anonymous true
protocol mqtt

max_queued_messages 1000
#Same behavior `queue_qos0_messages true`
queue_qos0_messages true
#Same behavior without persistence
persistence true

the compose file used to start the service

name: "mosquitto"

services:
  mosquitto-1:
    image: "eclipse-mosquitto:2.0.15-openssl"
    user: "1000:1000"
    volumes:
      - "./mosquitto.conf:/mosquitto/config/mosquitto.conf"
    ports:
      - 1883:1883

and there is the script used to test the behavior of persistent session

#/bin/sh

mosquitto_sub -h localhost -p 1883 -c -i persistent -t "greetings" -q 2 -v -d &
sub_pid=$!

mosquitto_pub -h localhost -p 1883 -c -i publisher -t "greetings" -m "hi" -q 2 -d
sleep 1
kill $sub_pid
sleep 1

mosquitto_pub -h localhost -p 1883 -c -i publisher -t "greetings" -m "hi no subscriber" -q 2 -d 
sleep 1
mosquitto_sub -h localhost -p 1883 -c -i persistent -t "greetings" -q 2 -v -d &
sub_pid=$!
sleep 10
kill $sub_pid

I need this feature for a project, may you explain what i missed to have it working ?

@github-actions github-actions bot added the Status: Available No one has claimed responsibility for resolving this issue. label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Available No one has claimed responsibility for resolving this issue.
Projects
None yet
Development

No branches or pull requests

1 participant