-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Subscriptions are not renewed when auto-reconnecting #221
Comments
It was a conscious decision not to do this. It is easy to do at the client level by subscribing in the on_connect() callback. |
Thanks for the info!
I used the on_connect() approach in my thin C++ wrapper. |
If you want to retain the subscriptions, then you have the option of connecting with cleansession=false. I do realize that there are drawbacks to this solution, given the semantics of clean session in MQTT (which should be solved in MQTT v5 incidentally). The Paho Java client has the same behaviour, so I think your information is wrong in that case. |
I'm going to close this as being the way that the MQTT 3.1.1 clients work. When V5 comes along, the protocol update will fix. |
If a connection to a MQTT broker is lost and auto-reconnected, subscriptions to topics are not renewed (not even with cleansession activated).
This is especially bad if the connection was lost due to a broker crash and the broker cannot (or does not want to) restore old sessions.
I was told (I did not confirm this) that the paho Java MQTT client does this correctly.
The text was updated successfully, but these errors were encountered: