Closed liulongblog closed 2 years ago
solved
@liulongblog Could you explain why did it happen and how to fix? I ran into the same issue and couldn't figure it out.
It seems to be a Mqtt5Client
problem. It just disappeared when I switched to Mqtt3Client
.
So my best guess is incompatible between Client and Broker.
It seems to be a
Mqtt5Client
problem. It just disappeared when I switched toMqtt3Client
. So my best guess is incompatible between Client and Broker.
my problem :client connect without synchronized, the same clientid was kicked by server
DisconnectedListener log : 2021-09-15 13:53:12.739 INFO 12892 --- [client.mqtt-4-6] com.....mqtt.MqttClient : [MqttClient] disconnected by SERVER, cause {}
com.hivemq.client.mqtt.exceptions.ConnectionClosedException: Server closed connection without DISCONNECT.
client config as follow: Mqtt3ClientBuilder mqtt3ClientBuilder = com.hivemq.client.mqtt.MqttClient.builder() .useMqttVersion3() .identifier(clientId) .serverHost(StringUtils.substringBetween(properties.getUrl(), "//", ":")) .serverPort(Integer.parseInt(StringUtils.substringAfterLast(properties.getUrl(), ":"))) .addConnectedListener(mqttClientConnectedListener) .addDisconnectedListener(mqttClientDisconnectedListener)
can i consume that is a problem of server?