eclipse-paho / paho.mqtt.java

Eclipse Paho Java MQTT client library. Paho is an Eclipse IoT project.
https://eclipse.org/paho
Other
2.15k stars 893 forks source link

'setAutomaticReconnect' not reconnection, when broker is initially not available #930

Open hinterwaldlerFlo opened 2 years ago

hinterwaldlerFlo commented 2 years ago

When using connOpts.setAutomaticReconnect(true) I was expecting, that the client also remains trying to connect to the broker, when the broker was not available on the first try. But for me the automatic reconnect just works, when the broker become unavailable during runtime.

Is that intended behavior?

Thanks

I am using: "org.eclipse.paho" % "org.eclipse.paho.client.mqttv3" % "1.2.5",

kroutal commented 2 years ago

Hello, I'm also facing the same issue. The "MqttAsyncClient.startReconnectCycle()" method should be called when first connection fails and automaticReconnect is set to true. Is there a way to handle this ?

Thanks