Open Zugschlus opened 2 hours ago
$ unzip -v paho-mqtt-871.zip Archive: paho-mqtt-871.zip
Length Method Size Cmpr Date Time CRC-32 Name
-------- ------ ------- ---- ---------- ----- -------- ----
4484 Defl:N 1282 71% 2024-11-16 07:51 607070ad paho-mqtt-871-reproducer
195 Defl:N 131 33% 2024-11-16 07:51 5b400824 mosquitto.conf
448 Defl:N 239 47% 2024-11-16 07:51 b0b08d1f docker-compose.yml
-------- ------- --- -------
5127 1652 68% 3 files
Sorry, github didn't allow me to upload those files directly ("unsupported file type")
Hi,
I have an simple program that connects to a server (which is mosquitto running in docker). I have added some error handling so that the client doesn't abort when the server dies or restarts. My program subscribes to a topic in the on_connect method. When the server restarts, the client reconnects to the server, but on_connect is not called.
Reproduction
Start the attached program with --console-loglevel=debug. Let it sit for a few seconds:
then restart the server (on my machine: docker compose restart), keeping the reproducer running
notice that the "Connected to MQTT broker" and the "Subscribed to self.subscribe_topic" is not present.
I don't claim that I am doing things right. But the docs are silent on error handling.
Sorry that my example needs your own MQTT broker, but you can't restart a public broker on request.
Environment
Thanks for your consideration, and for providing paho-mqtt in the first place.
Greetings, Marc