Closed fpagliughi closed 3 months ago
Remember on_connection_lost()
is fired when the connection is unexpectedly lost, but it's on_disconnected()
that fires on a clean disconnect from the broker.
It appears that there is also an upstream issue affecting this... https://github.com/eclipse/paho.mqtt.c/issues/1419
Pushed this back to v1.4 release to allow the upstream issue to resolve.
Found it... the call to start_consuming()
was not registering the 'on_disconnected' handler.
The fix is in the v1.4.x branch and will go out with v1.4.1 and v1.5
When a consumer application is receiving messages from a queue, it gets a null/empty message pointer when the client is unexpectedly disconnected from the broker.
But this notification does not arrive if the broker cleanly disconnects from the client by sending a DISCONNECT packet