环境信息
-
EMQ X 版本:4.3.6
-
操作系统及版本:CentOS Linux release 7.9.2009 (Core)
-
其他
报错信息:
2021-08-03 22:44:49.721 [MQTT Call: personnel-service-1311-t] INFO com.znv.personnel.mqtt.common.MqttClientConfig - emq重连成功,是否是重连:true,服务地址:ws://
2021-08-03 22:46:49.726 [MQTT Ping: personnel-service-1311-t] ERROR o.eclipse.paho.client.mqttv3.internal.ClientState - personnel-service-1311-t: Timed out as no activity, keepAlive=60,000,000,000 lastOutboundActivity=19,838,129,920,573,717 lastInboundActivity=19,838,069,923,407,383 time=19,838,189,920,445,703 lastPing=19,838,129,920,589,493
2021-08-03 22:46:49.730 [MQTT Ping: personnel-service-1311-t] WARN com.znv.personnel.mqtt.common.MqttClientConfig - emq连接断开,msg:Timed out waiting for a response from the server (32000)
2021-08-03 22:46:49.730 [MQTT Call: personnel-service-1311-t] ERROR com.znv.personnel.mqtt.common.MqttRegistry - 订阅emq主题失败,主题:ganges-data-door-event,主题监听beanName:personnnelPassCallback
org.eclipse.paho.client.mqttv3.MqttException: Timed out waiting for a response from the server
at org.eclipse.paho.client.mqttv3.internal.ExceptionHelper.createMqttException(ExceptionHelper.java:31)
at org.eclipse.paho.client.mqttv3.internal.ClientState.checkForActivity(ClientState.java:742)
at org.eclipse.paho.client.mqttv3.internal.ClientComms.checkForActivity(ClientComms.java:816)
at org.eclipse.paho.client.mqttv3.internal.ClientComms.checkForActivity(ClientComms.java:802)
at org.eclipse.paho.client.mqttv3.TimerPingSender$PingTask.run(TimerPingSender.java:79)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
问题描述
线上emq服务器在运行一段时间后会发生断连现象,并且重连成功但订阅主题失败
(这里重连后失败我看日志是因为重连以后又立刻断开了,导致订阅主题失败)
本地测试重连订阅主题没有问题
配置文件及日志
配置文件:
设置的参数:
线上断连报错:
然后顺着错误追到了源码:
错误是在这里抛出的
很是不解,本地没有这个问题 ,到线上就出现了
这个错误到底是什么原因导致的呢