Open HankB opened 2 years ago
Performed some testing using a mosquitto_pub
connection to localhost
(default) and explicitly providing the broker host name. Test performed was:
./MQTT_will.sh -b rocinante -i 30
still connected
messageResults. At step 5, the subscriber received the will message. At step 7 the client immediately received the still connected
message and subsequent to that received more still connected
messages.
Conclusion: mosquitto_pub
(and mosquitto_sub
) will both reconnect if the broker is bounced. In this test case there was an orderly shutdown. Possible situation with this bug is that the broker hung rather than stopped. If the situation recurs, one test to perform would be to try to subscribe to the broker before bouncing it.
At one point in time the broker stopped distributing all messages. It's Docker container was restarted and traffic resumed, but
mosquito_pub
used in this script never reconnected.