I have the following listeners:
var client = Mqtt3Client.builder().serverHost(host).serverPort(1883).identifier(clientId).addConnectedListener(
context -> System.out.println("connected " + LocalTime.now() + " host: " + context.getClientConfig().getServerHost()
+ " client: " + context.getClientConfig().getClientIdentifier())).addDisconnectedListener(context -> {
System.out.println("disconnected - " + " cause: " + context.getCause() + " source:" + context.getSource() + " " + LocalTime.now());
context.getReconnector()
.reconnect(context.getSource() != MqttDisconnectSource.USER)
.delay(2 * context.getReconnector().getAttempts(), TimeUnit.SECONDS);
}).buildBlocking();
client.connectWith().simpleAuth().username(user).password(UTF_8.encode(passwd)).applySimpleAuth().send();
Occasionaly, I get this:
Sep 11 19:50:32 cama java[20789]: disconnected - cause: com.hivemq.client.mqtt.exceptions.ConnectionClosedException: Server closed connection without DISCONNECT. source:SERVER 19:50:32.254664938
Sep 11 19:50:32 cama java[20789]: disconnected - cause: com.hivemq.client.mqtt.exceptions.ConnectionClosedException: Server closed connection without DISCONNECT. source:SERVER 19:50:32.555904961
Sep 11 19:50:34 cama java[20789]: disconnected - cause: com.hivemq.client.mqtt.exceptions.ConnectionClosedException: Server closed connection without DISCONNECT. source:SERVER 19:50:34.609964
Sep 11 19:50:38 cama java[20789]: disconnected - cause: com.hivemq.client.mqtt.exceptions.ConnectionClosedException: Server closed connection without DISCONNECT. source:SERVER 19:50:38.658020411
....
However, there seems to be no reconnect attempt ?
Kind regards
Peter