环境信息
- EMQ X 版本:4.2.1
- 操作系统及版本:linux cenos7.9
- 其他
问题描述
两台客户端连接上了emqx接收消息,测试运行一段时间(10来天吧)会出现断开重连的情况,一台能连接上,另一台连接不上,而且是在同一时间断开重连
这一台是连接不上的日志:
---MQTT连接异常:Unable to connect to server
engine|2021-11-30 15:07:12.107|[MQTT Ping: engine-test-1]|ERROR|o.eclipse.paho.mqttv5.client.internal.ClientState.logToJsr47(210)|engine-test-1: Timed out as no activity, keepAlive=60,000,000,000 lastOutboundActivity=5,781,585,183,163,891 lastInboundActivity=5,781,525,179,593,904 time=5,781,645,183,630,211 lastPing=5,781,585,183,166,651
连接断开,正在重连
engine|2021-11-30 15:05:12.104|[MQTT Rec: engine-test-1]|INFO|com.dgindusoft.mqtt.MqttPushClient.connect(69)|MQTT连接成功
上面显示连接成功实际没有成功,当然连接后再次订阅也没有订阅成功
这一台是连接上的日志:
---MQTT连接异常:Unable to connect to server
engine|2021-11-30 15:06:12.496|[MQTT Rec: engine-test-2]|ERROR|com.dgindusoft.mqtt.MqttPushClient.connect(73)|---MQTT连接异常:Not authorized.
engine|2021-11-30 15:06:17.830|[MQTT Rec: engine-test-2]|ERROR|com.dgindusoft.mqtt.MqttPushClient.connect(73)|---MQTT连接异常:Not authorized.
engine|2021-11-30 15:06:23.165|[MQTT Rec: engine-test-2]|ERROR|com.dgindusoft.mqtt.MqttPushClient.connect(73)|---MQTT连接异常:Not authorized.
连接断开,正在重连
engine|2021-11-30 15:05:12.104|[MQTT Rec: engine-test-2]|INFO|com.dgindusoft.mqtt.MqttPushClient.connect(69)|MQTT连接成功
engine|2021-11-30 15:05:12.104|[MQTT Call: engine-test-2]|INFO|com.dgindusoft.mqtt.PushCallback.connectComplete(147)|---connectComplete
engine|2021-11-30 15:05:12.415|[MQTT Call: engine-test-2]|INFO|com.dgindusoft.mqtt.PushCallback.connectComplete(183)|初始化设备总数:10,上线设备数量:7
engine|2021-11-30 15:06:12.161|[MQTT Rec: engine-test-2]|INFO|com.dgindusoft.mqtt.PushCallback.disconnected(209)|连接断开,正在重连
engine|2021-11-30 15:06:28.500|[MQTT Call: engine-test-2]|INFO|com.dgindusoft.mqtt.PushCallback.connectComplete(147)|---connectComplete
engine|2021-11-30 15:06:28.500|[MQTT Rec: engine-test-2]|INFO|com.dgindusoft.mqtt.MqttPushClient.connect(69)|MQTT连接成功
engine|2021-11-30 15:06:28.788|[MQTT Call: engine-test-2]|INFO|com.dgindusoft.mqtt.PushCallback.connectComplete(183)|初始化设备总数:10,上线设备数量:5
这个连接成功,也订阅成功了