MQTT reconnection | Thales IoT Developer Community
February 23, 2021 - 10:59am, 1275 views
I am using the MQTT library "MqttClient2016.jar" taken from: https://iot-developer.thalesgroup.com/comment/9842#comment-9842
The connection works perfectly for me and receives the messages without any problem.
I have the problem if the internet connection is lost, or if the server is restarted. It does not reconnect. I configure the options with the following command:
as indicated by the main class in the example.
I use the MyMqttCallback interface that also appears in the main class.
When the connection is lost, I get the message "[MyMqttCallback]: Connection lost because"
So it detects the loss, but then it does nothing more, and I keep sending messages and it does not receive them again once the connection is lost.
Should I do anything else to make the reconnection work?
Or should I do this reconnection on my own?