-
Notifications
You must be signed in to change notification settings - Fork 273
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
The messages are lost #295
Comments
The QoS value used during subscription is the highest QoS you will accept. Meaning, if you subscribe with QoS of 0, then you will not be sent messages published with a QoS of 1 or 2. This is part of the protocol. |
Two principles here:
When a message is published, it travels to the broker with a certain QoS. The broker then distributes it to the subscribers and possibly downgrading the QoS to match the clients subscription. QoS is, however, not upgraded. |
I was facing similar issue and end-up on this thread. I'm subscribing to about 40 topics. Some topics where not receiving the messages. |
I'm using AsyncMqttClient on ESP32 + Ardion-ESP. I found, that a lot of messages are lost. I would try to describe a problem:
On the client, I provide a callback function for onMessage with just one line: put received topic+message to the Serial for testing.
I didn't get a lot of messages, but when I look at server log I see:
2023-04-30 08:24:18.403 - debug: mqtt.0 (6565) Client [Board_7] send to this client "HeatPump/Board_7/Config/SSID": deleted
As a result, I have got messages just for 4-5 topics from 25 subscriptions.
What am I doing wrong?
UPDATE:
It happens when I run subscribe with QoS=2. I received all messages, when I subscribes with QoS=0. Why? I thought, that QoS=2 guarantees just that messages are delivered, but in real life it is not.
The text was updated successfully, but these errors were encountered: