Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mosquitto-dev] Weird? behavior of QoS 1 with retention

Hello everyone,

Recently it was brought to my attention that by retaining messages with QoS 1 and then subscribing to them with QoS 1, some messages seem to get lost (?).

It happened while using libmosquitto, but is easy to reproduce with command line tools:

for i in $(seq 1 200); do
  mosquitto_pub -q 1 -r -t "test/$i" -m "hello"
done

mosquitto_sub -q 1 -t 'test/+' -v -W 1 | wc -l

This yields a count of 120. Increasing the timeout makes no difference. Change the subscriber to use QoS 0, and the result is 200, proving that the messages are definitely still in the broker

I realize that max_queued_messages (to e.g., 1000) changes this... But is this expected behavior?

Kind regards,
Abilio

Back to the top