java org.eclipse.paho.client.mqttv3.MqttClient (1.2.5)隔一段时间超时,无法重连成功

1.java 采用paho连接emqx5.6.1,隔一段时间网络波动,超时。
监听到连接丢失,也重连,一直连不上。只有重启java服务才能连上
2【应用日志】
2025-08-31 02:57:47.873 [ERROR] MQTT Ping: ftaq-pt JSR47Logger.java:210 org.eclipse.paho.client.mqttv3.internal.ClientState ftaq-pt: Timed out as no activity, keepAlive=120,000,000,000 lastOutboundActivity=30,709,038,146,065,344 lastInboundActivity=30,708,975,831,123,223 time=30,709,158,145,876,333 lastPing=30,709,038,146,073,503
2025-08-31 02:57:47.875 [ERROR] MQTT Ping: ftaq-pt MqttCallback.java:67 com.scasst.scp.admin.mqtt.MqttCallback ftaq-pt mqtt connectionLost 连接断开: 等待来自服务器的响应时超时
2025-08-31 03:00:00.001 [ERROR] scheduling-7 MqttClient.java:87 com.scasst.scp.admin.mqtt.MqttClient 定时任务 MQTT连接异常: 已在进行连接
2025-08-31 03:00:00.011 [INFO ] scheduling-2 AlarmHandleService.java:83 com.scasst.scp.admin.service.AlarmHandleService 重新加载所有设备配置信息成功
2025-08-31 03:04:00.002 [ERROR] scheduling-7 MqttClient.java:87 com.scasst.scp.admin.mqtt.MqttClient 定时任务 MQTT连接异常: 客户机未连接
2025-08-31 03:05:00.012 [INFO ] scheduling-4 AlarmHandleService.java:83 com.scasst.scp.admin.service.AlarmHandleService 重新加载所有设备配置信息成功
2025-08-31 03:08:00.000 [ERROR] scheduling-5 MqttClient.java:87 com.scasst.scp.admin.mqtt.MqttClient 定时任务 MQTT连接异常: 已在进行连接
2025-08-31 03:10:00.016 [INFO ] scheduling-3 AlarmHandleService.java:83 com.scasst.scp.admin.service.AlarmHandleService 重新加载所有设备配置信息成功
2025-08-31 03:12:00.000 [ERROR] scheduling-6 MqttClient.java:87 com.scasst.scp.admin.mqtt.MqttClient 定时任务 MQTT连接异常: 已在进行连接
2025-08-31 03:15:00.012 [INFO ] scheduling-1 AlarmHandleService.java:83 com.scasst.scp.admin.service.AlarmHandleService 重新加载所有设备配置信息成功
2025-08-31 03:16:00.003 [ERROR] scheduling-2 MqttClient.java:87 com.scasst.scp.admin.mqtt.MqttClient 定时任务 MQTT连接异常: 客户机未连接
2025-08-31 03:20:00.000 [ERROR] scheduling-4 MqttClient.java:87 com.scasst.scp.admin.mqtt.MqttClient 定时任务 MQTT连接异常: 已在进行连接
2025-08-31 03:20:00.013 [INFO ] scheduling-7 AlarmHandleService.java:83 com.scasst.scp.admin.service.AlarmHandleService 重新加载所有设备配置信息成功
2025-08-31 03:24:00.000 [ERROR] scheduling-4 MqttClient.java:87 com.scasst.scp.admin.mqtt.MqttClient 定时任务 MQTT连接异常: 已在进行连接
2025-08-31 03:25:00.010 [INFO ] scheduling-6 AlarmHandleService.java:83 com.scasst.scp.admin.service.AlarmHandleService 重新加载所有设备配置信息成功
2025-08-31 03:28:00.002 [ERROR] scheduling-1 MqttClient.java:87 com.scasst.scp.admin.mqtt.MqttClient 定时任务 MQTT连接异常: 客户机未连接
2025-08-31 03:30:00.012 [INFO ] scheduling-2 AlarmHandleService.java:83 com.scasst.scp.admin.service.AlarmHandleService 重新加载所有设备配置信息成功
2025-08-31 03:32:00.001 [ERROR] scheduling-5 MqttClient.java:87 com.scasst.scp.admin.mqtt.MqttClient 定时任务 MQTT连接异常: 已在进行连接
2025-08-31 03:35:00.011 [INFO ] scheduling-3 AlarmHandleService.java:83 com.scasst.scp.admin.service.AlarmHandleService 重新加载所有设备配置信息成功
2025-08-31 03:36:00.000 [ERROR] scheduling-7 MqttClient.java:87 com.scasst.scp.admin.mqtt.MqttClient 定时任务 MQTT连接异常: 已在进行连接
2025-08-31 03:40:00.003 [ERROR] scheduling-6 MqttClient.java:87 com.scasst.scp.admin.mqtt.MqttClient 定时任务 MQTT连接异常: 客户机未连接
2025-08-31 03:40:00.015 [INFO ] scheduling-4 AlarmHandleService.java:83 com.scasst.scp.admin.service.AlarmHandleService 重新加载所有设备配置信息成功
2025-08-31 03:44:00.000 [ERROR] scheduling-6 MqttClient.java:87 com.scasst.scp.admin.mqtt.MqttClient 定时任务 MQTT连接异常: 已在进行连接

3【emqx】日志:超时时间段,无我这个客户端相关日志

2025-08-30T04:40:25.923982+08:00 [warning] clientid: DL3, msg: SELECT_clause_exception, peername: 192.168.24.103:58200, username: ftkj, reason: {error,{decode_json_failed,<<1,3,2,0,3,248,69,1,3,2,0,3,248,69>>},[{emqx_rule_runtime,safe_decode_and_cache,1,[{file,“emqx_rule_runtime.erl”},{line,566}]},{emqx_rule_runtime,eval,2,[{file,“emqx_rule_runtime.erl”},{line,409}]},{emqx_rule_runtime,select_and_transform,3,[{file,“emqx_rule_runtime.erl”},{line,198}]},{emqx_rule_runtime,do_apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,169}]},{emqx_rule_runtime,apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,72}]},{emqx_rule_runtime,apply_rule_discard_result,3,[{file,“emqx_rule_runtime.erl”},{line,65}]},{emqx_rule_runtime,apply_rules,3,[{file,“emqx_rule_runtime.erl”},{line,61}]},{emqx_rule_events,on_message_publish,2,[{file,“emqx_rule_events.erl”},{line,142}]},{emqx_hooks,safe_execute,2,[{file,“emqx_hooks.erl”},{line,205}]},{emqx_hooks,do_run_fold,3,[{file,“emqx_hooks.erl”},{line,185}]},{emqx_broker,publish,1,[{file,“emqx_broker.erl”},{line,234}]},{emqx_channel,do_publish,3,[{file,“emqx_channel.erl”},{line,704}]},{emqx_connection,with_channel,3,[{file,“emqx_connection.erl”},{line,846}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,495}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,501}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,457}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,251}]}]}, rule_id: <<“rule_mq5a”>>
2025-08-30T08:50:00.517056+08:00 [warning] clientid: SJ4, msg: SELECT_clause_exception, peername: 192.168.24.103:36254, username: ftkj, reason: {error,{decode_json_failed,<<1,3,2,0,2,57,133,1,3,2,0,3,248,69>>},[{emqx_rule_runtime,safe_decode_and_cache,1,[{file,“emqx_rule_runtime.erl”},{line,566}]},{emqx_rule_runtime,eval,2,[{file,“emqx_rule_runtime.erl”},{line,409}]},{emqx_rule_runtime,select_and_transform,3,[{file,“emqx_rule_runtime.erl”},{line,198}]},{emqx_rule_runtime,do_apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,169}]},{emqx_rule_runtime,apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,72}]},{emqx_rule_runtime,apply_rule_discard_result,3,[{file,“emqx_rule_runtime.erl”},{line,65}]},{emqx_rule_runtime,apply_rules,3,[{file,“emqx_rule_runtime.erl”},{line,61}]},{emqx_rule_events,on_message_publish,2,[{file,“emqx_rule_events.erl”},{line,142}]},{emqx_hooks,safe_execute,2,[{file,“emqx_hooks.erl”},{line,205}]},{emqx_hooks,do_run_fold,3,[{file,“emqx_hooks.erl”},{line,185}]},{emqx_broker,publish,1,[{file,“emqx_broker.erl”},{line,234}]},{emqx_channel,do_publish,3,[{file,“emqx_channel.erl”},{line,704}]},{emqx_connection,with_channel,3,[{file,“emqx_connection.erl”},{line,846}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,495}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,501}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,457}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,251}]}]}, rule_id: <<“rule_1x3k”>>
2025-08-30T09:54:56.370701+08:00 [warning] clientid: DL4, msg: SELECT_clause_exception, peername: 192.168.24.103:39678, username: ftkj, reason: {error,{decode_json_failed,<<1,3,2,0,4,185,135,1,3,2,0,4,185,135>>},[{emqx_rule_runtime,safe_decode_and_cache,1,[{file,“emqx_rule_runtime.erl”},{line,566}]},{emqx_rule_runtime,eval,2,[{file,“emqx_rule_runtime.erl”},{line,409}]},{emqx_rule_runtime,select_and_transform,3,[{file,“emqx_rule_runtime.erl”},{line,198}]},{emqx_rule_runtime,do_apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,169}]},{emqx_rule_runtime,apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,72}]},{emqx_rule_runtime,apply_rule_discard_result,3,[{file,“emqx_rule_runtime.erl”},{line,65}]},{emqx_rule_runtime,apply_rules,3,[{file,“emqx_rule_runtime.erl”},{line,61}]},{emqx_rule_events,on_message_publish,2,[{file,“emqx_rule_events.erl”},{line,142}]},{emqx_hooks,safe_execute,2,[{file,“emqx_hooks.erl”},{line,205}]},{emqx_hooks,do_run_fold,3,[{file,“emqx_hooks.erl”},{line,185}]},{emqx_broker,publish,1,[{file,“emqx_broker.erl”},{line,234}]},{emqx_channel,do_publish,3,[{file,“emqx_channel.erl”},{line,704}]},{emqx_connection,with_channel,3,[{file,“emqx_connection.erl”},{line,846}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,495}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,501}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,457}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,251}]}]}, rule_id: <<“rule_llhe”>>
2025-08-30T10:20:43.161245+08:00 [warning] clientid: DL5, msg: SELECT_clause_exception, peername: 192.168.24.103:40944, username: ftkj, reason: {error,{decode_json_failed,<<1,3,2,0,0,184,68,1,3,2,0,0,184,68>>},[{emqx_rule_runtime,safe_decode_and_cache,1,[{file,“emqx_rule_runtime.erl”},{line,566}]},{emqx_rule_runtime,eval,2,[{file,“emqx_rule_runtime.erl”},{line,409}]},{emqx_rule_runtime,select_and_transform,3,[{file,“emqx_rule_runtime.erl”},{line,198}]},{emqx_rule_runtime,do_apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,169}]},{emqx_rule_runtime,apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,72}]},{emqx_rule_runtime,apply_rule_discard_result,3,[{file,“emqx_rule_runtime.erl”},{line,65}]},{emqx_rule_runtime,apply_rules,3,[{file,“emqx_rule_runtime.erl”},{line,61}]},{emqx_rule_events,on_message_publish,2,[{file,“emqx_rule_events.erl”},{line,142}]},{emqx_hooks,safe_execute,2,[{file,“emqx_hooks.erl”},{line,205}]},{emqx_hooks,do_run_fold,3,[{file,“emqx_hooks.erl”},{line,185}]},{emqx_broker,publish,1,[{file,“emqx_broker.erl”},{line,234}]},{emqx_channel,do_publish,3,[{file,“emqx_channel.erl”},{line,704}]},{emqx_connection,with_channel,3,[{file,“emqx_connection.erl”},{line,846}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,495}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,501}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,457}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,251}]}]}, rule_id: <<“rule_rg34”>>
2025-08-30T22:52:50.564032+08:00 [warning] clientid: DL3, msg: SELECT_clause_exception, peername: 192.168.24.103:42814, username: ftkj, reason: {error,{decode_json_failed,<<1,3,2,0,3,248,69,1,3,2,0,3,248,69>>},[{emqx_rule_runtime,safe_decode_and_cache,1,[{file,“emqx_rule_runtime.erl”},{line,566}]},{emqx_rule_runtime,eval,2,[{file,“emqx_rule_runtime.erl”},{line,409}]},{emqx_rule_runtime,select_and_transform,3,[{file,“emqx_rule_runtime.erl”},{line,198}]},{emqx_rule_runtime,do_apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,169}]},{emqx_rule_runtime,apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,72}]},{emqx_rule_runtime,apply_rule_discard_result,3,[{file,“emqx_rule_runtime.erl”},{line,65}]},{emqx_rule_runtime,apply_rules,3,[{file,“emqx_rule_runtime.erl”},{line,61}]},{emqx_rule_events,on_message_publish,2,[{file,“emqx_rule_events.erl”},{line,142}]},{emqx_hooks,safe_execute,2,[{file,“emqx_hooks.erl”},{line,205}]},{emqx_hooks,do_run_fold,3,[{file,“emqx_hooks.erl”},{line,185}]},{emqx_broker,publish,1,[{file,“emqx_broker.erl”},{line,234}]},{emqx_channel,do_publish,3,[{file,“emqx_channel.erl”},{line,704}]},{emqx_connection,with_channel,3,[{file,“emqx_connection.erl”},{line,846}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,495}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,501}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,457}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,251}]}]}, rule_id: <<“rule_mq5a”>>
2025-08-31T03:02:24.972067+08:00 [warning] clientid: SJ4, msg: SELECT_clause_exception, peername: 192.168.24.103:47282, username: ftkj, reason: {error,{decode_json_failed,<<1,3,2,0,3,248,69,1,3,2,0,3,248,69>>},[{emqx_rule_runtime,safe_decode_and_cache,1,[{file,“emqx_rule_runtime.erl”},{line,566}]},{emqx_rule_runtime,eval,2,[{file,“emqx_rule_runtime.erl”},{line,409}]},{emqx_rule_runtime,select_and_transform,3,[{file,“emqx_rule_runtime.erl”},{line,198}]},{emqx_rule_runtime,do_apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,169}]},{emqx_rule_runtime,apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,72}]},{emqx_rule_runtime,apply_rule_discard_result,3,[{file,“emqx_rule_runtime.erl”},{line,65}]},{emqx_rule_runtime,apply_rules,3,[{file,“emqx_rule_runtime.erl”},{line,61}]},{emqx_rule_events,on_message_publish,2,[{file,“emqx_rule_events.erl”},{line,142}]},{emqx_hooks,safe_execute,2,[{file,“emqx_hooks.erl”},{line,205}]},{emqx_hooks,do_run_fold,3,[{file,“emqx_hooks.erl”},{line,185}]},{emqx_broker,publish,1,[{file,“emqx_broker.erl”},{line,234}]},{emqx_channel,do_publish,3,[{file,“emqx_channel.erl”},{line,704}]},{emqx_connection,with_channel,3,[{file,“emqx_connection.erl”},{line,846}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,495}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,501}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,457}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,251}]}]}, rule_id: <<“rule_1x3k”>>
2025-08-31T04:07:20.685512+08:00 [warning] clientid: DL4, msg: SELECT_clause_exception, peername: 192.168.24.103:48298, username: ftkj, reason: {error,{decode_json_failed,<<1,3,2,0,4,185,135,1,3,2,0,4,185,135>>},[{emqx_rule_runtime,safe_decode_and_cache,1,[{file,“emqx_rule_runtime.erl”},{line,566}]},{emqx_rule_runtime,eval,2,[{file,“emqx_rule_runtime.erl”},{line,409}]},{emqx_rule_runtime,select_and_transform,3,[{file,“emqx_rule_runtime.erl”},{line,198}]},{emqx_rule_runtime,do_apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,169}]},{emqx_rule_runtime,apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,72}]},{emqx_rule_runtime,apply_rule_discard_result,3,[{file,“emqx_rule_runtime.erl”},{line,65}]},{emqx_rule_runtime,apply_rules,3,[{file,“emqx_rule_runtime.erl”},{line,61}]},{emqx_rule_events,on_message_publish,2,[{file,“emqx_rule_events.erl”},{line,142}]},{emqx_hooks,safe_execute,2,[{file,“emqx_hooks.erl”},{line,205}]},{emqx_hooks,do_run_fold,3,[{file,“emqx_hooks.erl”},{line,185}]},{emqx_broker,publish,1,[{file,“emqx_broker.erl”},{line,234}]},{emqx_channel,do_publish,3,[{file,“emqx_channel.erl”},{line,704}]},{emqx_connection,with_channel,3,[{file,“emqx_connection.erl”},{line,846}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,495}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,501}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,457}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,251}]}]}, rule_id: <<“rule_llhe”>>
2025-08-31T04:33:07.838854+08:00 [warning] clientid: DL5, msg: SELECT_clause_exception, peername: 192.168.24.103:48626, username: ftkj, reason: {error,{decode_json_failed,<<1,3,2,0,0,184,68,1,3,2,0,0,184,68>>},[{emqx_rule_runtime,safe_decode_and_cache,1,[{file,“emqx_rule_runtime.erl”},{line,566}]},{emqx_rule_runtime,eval,2,[{file,“emqx_rule_runtime.erl”},{line,409}]},{emqx_rule_runtime,select_and_transform,3,[{file,“emqx_rule_runtime.erl”},{line,198}]},{emqx_rule_runtime,do_apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,169}]},{emqx_rule_runtime,apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,72}]},{emqx_rule_runtime,apply_rule_discard_result,3,[{file,“emqx_rule_runtime.erl”},{line,65}]},{emqx_rule_runtime,apply_rules,3,[{file,“emqx_rule_runtime.erl”},{line,61}]},{emqx_rule_events,on_message_publish,2,[{file,“emqx_rule_events.erl”},{line,142}]},{emqx_hooks,safe_execute,2,[{file,“emqx_hooks.erl”},{line,205}]},{emqx_hooks,do_run_fold,3,[{file,“emqx_hooks.erl”},{line,185}]},{emqx_broker,publish,1,[{file,“emqx_broker.erl”},{line,234}]},{emqx_channel,do_publish,3,[{file,“emqx_channel.erl”},{line,704}]},{emqx_connection,with_channel,3,[{file,“emqx_connection.erl”},{line,846}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,495}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,501}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,457}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,251}]}]}, rule_id: <<“rule_rg34”>>
2025-08-31T17:05:15.179046+08:00 [warning] clientid: DL3, msg: SELECT_clause_exception, peername: 192.168.24.103:43962, username: ftkj, reason: {error,{decode_json_failed,<<1,3,2,0,3,248,69,1,3,2,0,3,248,69>>},[{emqx_rule_runtime,safe_decode_and_cache,1,[{file,“emqx_rule_runtime.erl”},{line,566}]},{emqx_rule_runtime,eval,2,[{file,“emqx_rule_runtime.erl”},{line,409}]},{emqx_rule_runtime,select_and_transform,3,[{file,“emqx_rule_runtime.erl”},{line,198}]},{emqx_rule_runtime,do_apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,169}]},{emqx_rule_runtime,apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,72}]},{emqx_rule_runtime,apply_rule_discard_result,3,[{file,“emqx_rule_runtime.erl”},{line,65}]},{emqx_rule_runtime,apply_rules,3,[{file,“emqx_rule_runtime.erl”},{line,61}]},{emqx_rule_events,on_message_publish,2,[{file,“emqx_rule_events.erl”},{line,142}]},{emqx_hooks,safe_execute,2,[{file,“emqx_hooks.erl”},{line,205}]},{emqx_hooks,do_run_fold,3,[{file,“emqx_hooks.erl”},{line,185}]},{emqx_broker,publish,1,[{file,“emqx_broker.erl”},{line,234}]},{emqx_channel,do_publish,3,[{file,“emqx_channel.erl”},{line,704}]},{emqx_connection,with_channel,3,[{file,“emqx_connection.erl”},{line,846}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,495}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,501}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,457}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,251}]}]}, rule_id: <<“rule_mq5a”>>
2025-08-31T21:14:49.365354+08:00 [warning] clientid: SJ4, msg: SELECT_clause_exception, peername: 192.168.24.103:52488, username: ftkj, reason: {error,{decode_json_failed,<<1,3,2,0,3,248,69,1,3,2,0,3,248,69>>},[{emqx_rule_runtime,safe_decode_and_cache,1,[{file,“emqx_rule_runtime.erl”},{line,566}]},{emqx_rule_runtime,eval,2,[{file,“emqx_rule_runtime.erl”},{line,409}]},{emqx_rule_runtime,select_and_transform,3,[{file,“emqx_rule_runtime.erl”},{line,198}]},{emqx_rule_runtime,do_apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,169}]},{emqx_rule_runtime,apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,72}]},{emqx_rule_runtime,apply_rule_discard_result,3,[{file,“emqx_rule_runtime.erl”},{line,65}]},{emqx_rule_runtime,apply_rules,3,[{file,“emqx_rule_runtime.erl”},{line,61}]},{emqx_rule_events,on_message_publish,2,[{file,“emqx_rule_events.erl”},{line,142}]},{emqx_hooks,safe_execute,2,[{file,“emqx_hooks.erl”},{line,205}]},{emqx_hooks,do_run_fold,3,[{file,“emqx_hooks.erl”},{line,185}]},{emqx_broker,publish,1,[{file,“emqx_broker.erl”},{line,234}]},{emqx_channel,do_publish,3,[{file,“emqx_channel.erl”},{line,704}]},{emqx_connection,with_channel,3,[{file,“emqx_connection.erl”},{line,846}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,495}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,501}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,457}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,251}]}]}, rule_id: <<“rule_1x3k”>>
2025-08-31T22:19:45.363033+08:00 [warning] clientid: DL4, msg: SELECT_clause_exception, peername: 192.168.24.103:54582, username: ftkj, reason: {error,{decode_json_failed,<<1,3,2,0,10,56,67,1,3,2,0,11,249,131>>},[{emqx_rule_runtime,safe_decode_and_cache,1,[{file,“emqx_rule_runtime.erl”},{line,566}]},{emqx_rule_runtime,eval,2,[{file,“emqx_rule_runtime.erl”},{line,409}]},{emqx_rule_runtime,select_and_transform,3,[{file,“emqx_rule_runtime.erl”},{line,198}]},{emqx_rule_runtime,do_apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,169}]},{emqx_rule_runtime,apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,72}]},{emqx_rule_runtime,apply_rule_discard_result,3,[{file,“emqx_rule_runtime.erl”},{line,65}]},{emqx_rule_runtime,apply_rules,3,[{file,“emqx_rule_runtime.erl”},{line,61}]},{emqx_rule_events,on_message_publish,2,[{file,“emqx_rule_events.erl”},{line,142}]},{emqx_hooks,safe_execute,2,[{file,“emqx_hooks.erl”},{line,205}]},{emqx_hooks,do_run_fold,3,[{file,“emqx_hooks.erl”},{line,185}]},{emqx_broker,publish,1,[{file,“emqx_broker.erl”},{line,234}]},{emqx_channel,do_publish,3,[{file,“emqx_channel.erl”},{line,704}]},{emqx_connection,with_channel,3,[{file,“emqx_connection.erl”},{line,846}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,495}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,501}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,457}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,251}]}]}, rule_id: <<“rule_llhe”>>
2025-08-31T22:45:32.380568+08:00 [warning] clientid: DL5, msg: SELECT_clause_exception, peername: 192.168.24.103:55210, username: ftkj, reason: {error,{decode_json_failed,<<1,3,2,0,0,184,68,1,3,2,0,0,184,68>>},[{emqx_rule_runtime,safe_decode_and_cache,1,[{file,“emqx_rule_runtime.erl”},{line,566}]},{emqx_rule_runtime,eval,2,[{file,“emqx_rule_runtime.erl”},{line,409}]},{emqx_rule_runtime,select_and_transform,3,[{file,“emqx_rule_runtime.erl”},{line,198}]},{emqx_rule_runtime,do_apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,169}]},{emqx_rule_runtime,apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,72}]},{emqx_rule_runtime,apply_rule_discard_result,3,[{file,“emqx_rule_runtime.erl”},{line,65}]},{emqx_rule_runtime,apply_rules,3,[{file,“emqx_rule_runtime.erl”},{line,61}]},{emqx_rule_events,on_message_publish,2,[{file,“emqx_rule_events.erl”},{line,142}]},{emqx_hooks,safe_execute,2,[{file,“emqx_hooks.erl”},{line,205}]},{emqx_hooks,do_run_fold,3,[{file,“emqx_hooks.erl”},{line,185}]},{emqx_broker,publish,1,[{file,“emqx_broker.erl”},{line,234}]},{emqx_channel,do_publish,3,[{file,“emqx_channel.erl”},{line,704}]},{emqx_connection,with_channel,3,[{file,“emqx_connection.erl”},{line,846}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,495}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,501}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,457}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,251}]}]}, rule_id: <<“rule_rg34”>>
2025-09-01T11:17:39.903746+08:00 [warning] clientid: DL3, msg: SELECT_clause_exception, peername: 192.168.24.103:46070, username: ftkj, reason: {error,{decode_json_failed,<<1,3,2,0,3,248,69,1,3,2,0,3,248,69>>},[{emqx_rule_runtime,safe_decode_and_cache,1,[{file,“emqx_rule_runtime.erl”},{line,566}]},{emqx_rule_runtime,eval,2,[{file,“emqx_rule_runtime.erl”},{line,409}]},{emqx_rule_runtime,select_and_transform,3,[{file,“emqx_rule_runtime.erl”},{line,198}]},{emqx_rule_runtime,do_apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,169}]},{emqx_rule_runtime,apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,72}]},{emqx_rule_runtime,apply_rule_discard_result,3,[{file,“emqx_rule_runtime.erl”},{line,65}]},{emqx_rule_runtime,apply_rules,3,[{file,“emqx_rule_runtime.erl”},{line,61}]},{emqx_rule_events,on_message_publish,2,[{file,“emqx_rule_events.erl”},{line,142}]},{emqx_hooks,safe_execute,2,[{file,“emqx_hooks.erl”},{line,205}]},{emqx_hooks,do_run_fold,3,[{file,“emqx_hooks.erl”},{line,185}]},{emqx_broker,publish,1,[{file,“emqx_broker.erl”},{line,234}]},{emqx_channel,do_publish,3,[{file,“emqx_channel.erl”},{line,704}]},{emqx_connection,with_channel,3,[{file,“emqx_connection.erl”},{line,846}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,495}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,501}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,457}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,251}]}]}, rule_id: <<“rule_mq5a”>>
2025-09-01T14:48:08.950481+08:00 [warning] tag: AUTHN, clientid: PJ, msg: authentication_failure, peername: 192.168.23.90:62583, username: ftkjllj, reason: not_authorized
2025-09-01T14:48:30.809122+08:00 [warning] tag: AUTHN, clientid: PJ, msg: authentication_failure, peername: 192.168.23.90:62616, username: ftkjllj, reason: not_authorized
2025-09-01T14:49:30.624508+08:00 [warning] msg: log_events_throttled_during_last_period, period: 1 minutes, 0 seconds, dropped: #{authentication_failure => 2}
2025-09-01T14:52:51.249688+08:00 [warning] tag: AUTHN, clientid: ZKSCADA172.16.2.220, msg: authentication_failure, peername: 172.16.2.220:54024, username: ftkjllj, reason: not_authorized
2025-09-01T14:53:30.628542+08:00 [warning] msg: log_events_throttled_during_last_period, period: 1 minutes, 0 seconds, dropped: #{authentication_failure => 2277}
2025-09-01T14:53:30.628709+08:00 [warning] tag: AUTHN, clientid: ZKSCADA172.16.2.220, msg: authentication_failure, peername: 172.16.2.220:56668, username: ftkjllj, reason: not_authorized
2025-09-01T14:54:30.629524+08:00 [warning] msg: log_events_throttled_during_last_period, period: 1 minutes, 0 seconds, dropped: #{authentication_failure => 3810}
2025-09-01T14:54:30.633768+08:00 [warning] tag: AUTHN, clientid: ZKSCADA172.16.2.220, msg: authentication_failure, peername: 172.16.2.220:60874, username: ftkjllj, reason: not_authorized
2025-09-01T14:55:30.630504+08:00 [warning] msg: log_events_throttled_during_last_period, period: 1 minutes, 0 seconds, dropped: #{authentication_failure => 3817}
2025-09-01T14:55:30.633202+08:00 [warning] tag: AUTHN, clientid: ZKSCADA172.16.2.220, msg: authentication_failure, peername: 172.16.2.220:65116, username: ftkjllj, reason: not_authorized
2025-09-01T14:56:30.631479+08:00 [warning] msg: log_events_throttled_during_last_period, period: 1 minutes, 0 seconds, dropped: #{authentication_failure => 2149}
2025-09-01T15:27:13.872461+08:00 [warning] clientid: SJ4, msg: SELECT_clause_exception, peername: 192.168.24.103:58060, username: ftkj, reason: {error,{decode_json_failed,<<1,3,2,0,3,248,69,1,3,2,0,3,248,69>>},[{emqx_rule_runtime,safe_decode_and_cache,1,[{file,“emqx_rule_runtime.erl”},{line,566}]},{emqx_rule_runtime,eval,2,[{file,“emqx_rule_runtime.erl”},{line,409}]},{emqx_rule_runtime,select_and_transform,3,[{file,“emqx_rule_runtime.erl”},{line,198}]},{emqx_rule_runtime,do_apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,169}]},{emqx_rule_runtime,apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,72}]},{emqx_rule_runtime,apply_rule_discard_result,3,[{file,“emqx_rule_runtime.erl”},{line,65}]},{emqx_rule_runtime,apply_rules,3,[{file,“emqx_rule_runtime.erl”},{line,61}]},{emqx_rule_events,on_message_publish,2,[{file,“emqx_rule_events.erl”},{line,142}]},{emqx_hooks,safe_execute,2,[{file,“emqx_hooks.erl”},{line,205}]},{emqx_hooks,do_run_fold,3,[{file,“emqx_hooks.erl”},{line,185}]},{emqx_broker,publish,1,[{file,“emqx_broker.erl”},{line,234}]},{emqx_channel,do_publish,3,[{file,“emqx_channel.erl”},{line,704}]},{emqx_connection,with_channel,3,[{file,“emqx_connection.erl”},{line,846}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,495}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,501}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,457}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,251}]}]}, rule_id: <<“rule_1x3k”>>
2025-09-01T16:32:09.922271+08:00 [warning] clientid: DL4, msg: SELECT_clause_exception, peername: 192.168.24.103:60594, username: ftkj, reason: {error,{decode_json_failed,<<1,3,2,0,4,185,135,1,3,2,0,4,185,135>>},[{emqx_rule_runtime,safe_decode_and_cache,1,[{file,“emqx_rule_runtime.erl”},{line,566}]},{emqx_rule_runtime,eval,2,[{file,“emqx_rule_runtime.erl”},{line,409}]},{emqx_rule_runtime,select_and_transform,3,[{file,“emqx_rule_runtime.erl”},{line,198}]},{emqx_rule_runtime,do_apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,169}]},{emqx_rule_runtime,apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,72}]},{emqx_rule_runtime,apply_rule_discard_result,3,[{file,“emqx_rule_runtime.erl”},{line,65}]},{emqx_rule_runtime,apply_rules,3,[{file,“emqx_rule_runtime.erl”},{line,61}]},{emqx_rule_events,on_message_publish,2,[{file,“emqx_rule_events.erl”},{line,142}]},{emqx_hooks,safe_execute,2,[{file,“emqx_hooks.erl”},{line,205}]},{emqx_hooks,do_run_fold,3,[{file,“emqx_hooks.erl”},{line,185}]},{emqx_broker,publish,1,[{file,“emqx_broker.erl”},{line,234}]},{emqx_channel,do_publish,3,[{file,“emqx_channel.erl”},{line,704}]},{emqx_connection,with_channel,3,[{file,“emqx_connection.erl”},{line,846}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,495}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,501}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,457}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,251}]}]}, rule_id: <<“rule_llhe”>>
2025-09-01T16:57:57.016222+08:00 [warning] clientid: DL5, msg: SELECT_clause_exception, peername: 192.168.24.103:33570, username: ftkj, reason: {error,{decode_json_failed,<<1,3,2,0,0,184,68,1,3,2,0,0,184,68>>},[{emqx_rule_runtime,safe_decode_and_cache,1,[{file,“emqx_rule_runtime.erl”},{line,566}]},{emqx_rule_runtime,eval,2,[{file,“emqx_rule_runtime.erl”},{line,409}]},{emqx_rule_runtime,select_and_transform,3,[{file,“emqx_rule_runtime.erl”},{line,198}]},{emqx_rule_runtime,do_apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,169}]},{emqx_rule_runtime,apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,72}]},{emqx_rule_runtime,apply_rule_discard_result,3,[{file,“emqx_rule_runtime.erl”},{line,65}]},{emqx_rule_runtime,apply_rules,3,[{file,“emqx_rule_runtime.erl”},{line,61}]},{emqx_rule_events,on_message_publish,2,[{file,“emqx_rule_events.erl”},{line,142}]},{emqx_hooks,safe_execute,2,[{file,“emqx_hooks.erl”},{line,205}]},{emqx_hooks,do_run_fold,3,[{file,“emqx_hooks.erl”},{line,185}]},{emqx_broker,publish,1,[{file,“emqx_broker.erl”},{line,234}]},{emqx_channel,do_publish,3,[{file,“emqx_channel.erl”},{line,704}]},{emqx_connection,with_channel,3,[{file,“emqx_connection.erl”},{line,846}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,495}]},{emqx_connection,process_msg,2,[{file,“emqx_connection.erl”},{line,501}]},{emqx_connection,handle_recv,3,[{file,“emqx_connection.erl”},{line,457}]},{proc_lib,wake_up,3,[{file,“proc_lib.erl”},{line,251}]}]}, rule_id: <<“rule_rg34”>>
2025-09-02T05:30:04.461567+08:00 [warning] clientid: DL3, msg: SELECT_clause_exception, peername: 192.168.24.103:55696, username: ftkj, reason: {error,{decode_json_failed,<<1,3,2,0,3,248,69,1,3,2,0,3,248,69>>},[{emqx_rule_runtime,safe_decode_and_cache,1,[{file,“emqx_rule_runtime.erl”},{line,566}]},{emqx_rule_runtime,eval,2,[{file,“emqx_rule_runtime.erl”},{line,409}]},{emqx_rule_runtime,select_and_transform,3,[{file,“emqx_rule_runtime.erl”},{line,198}]},{emqx_rule_runtime,do_apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,169}]},{emqx_rule_runtime,apply_rule,3,[{file,“emqx_rule_runtime.erl”},{line,72}]},{emqx_rule_runtime,apply_rule_discard_result,3,[{file,“emqx_rule_runtime.erl”},{line,65}]},{emqx_rule_runtime,apply_rules,3,[{file,“emqx_rule_runtime.erl”},{line,61}]},{emqx_rule_events,on_message_publish,2,[{file,“emqx_rule_events.erl”},{line,142}]},{emqx_hooks,safe_execute,2,[{file,“emqx_hooks.erl”},{line,205}]},{emqx_hooks,do_run_fold,3,[{file,“emqx_hooks.erl”},{line,185}]},

MqttConnectOptions options = new MqttConnectOptions();
options.setUserName(username);
options.setPassword(password.toCharArray());
options.setConnectionTimeout(timeout);
options.setKeepAliveInterval(keepalive);
//配置服务器端是否清除session,如果配置为true,服务端会清除客户端session,则断线后需要重新订阅等
options.setCleanSession(true);
//设置断开后重新连接
options.setAutomaticReconnect(true);

mqtt.qos=0
mqtt.clientId=ftaq-pt
mqtt.timeout=120
mqtt.keepalive=120

这个是规则引擎里面想解码一个 json,但实际上传过来的不是 json. 就失败了。

PS:JAVA 的代码我看不懂。但是我只看字面意思也觉得没问题。

后台日志也监测到少数不是json.这样消息,偶尔来几条,会导致重连失败?

本地同样版本emqx5.6.1,频繁断开网线,插上网线,代码都能重连成功。

1.这个crash 日志 不会导致客户端断开。
2. 结合以下 2 点,建议可以从客户端代码 debug 开始排查(抱歉,我不会 java。可以问问其它高手)

连接断开: 等待来自服务器的响应时超时
2025-08-31 03:00:00.001 [ERROR] scheduling-7 MqttClient.java:87 com.scasst.scp.admin.mqtt.MqttClient 定时任务 MQTT连接异常: 已在进行连接。

代码另外一个mqtt客户端能重连成功,还是外网的

mqtt.timeout=10
mqtt.keepalive=40,
之前这两个参数配置120s

emqx服务端有没有设置比如设置遗嘱,才能重连成功?

没有