spring boot中使用org.eclipse.paho.client.mqttv3频繁断开与EMQX开源版的连接

spring boot中使用org.eclipse.paho.client.mqttv3频繁断开,EMQX是docker版安装的,5.7版本,基本启动连接1分钟就断开连接了,断开后重连,有时候连上马上就断开了,几个项目的情况都是这样的,请帮忙解决:
mqtt:
username: #
password: #
url: tcp://$(hostIp}:1883
clientid: ${random.value}
default-topic: test
timeout: 30
keepalive: 60000
subscribeFlag: true
以下是emqx打印的日志信息,说是socket关闭,不知道咋回事
2024-10-30T16:01:50.580144+00:00 [RULE_SQL_EXEC] 1111111111111@27.47.131.234:4555 msg: rule_activated, environment: , input: [clientid: 1111111111111, disconn_props: [User-Property: ], disconnected_at: 1730304110580, event: client.disconnected, node: emqx@172.17.0.2, peername: 27.47.131.234:4555, proto_name: MQTT, proto_ver: 4, reason: tcp_closed, sockname: 172.17.0.2:1883, timestamp: 1730304110580, username: oxygen001], rule_id: devicestate_WH_D, rule_trigger_ts: [1730304110580], username: oxygen001

2024-10-30T16:01:50.580230+00:00 [RULE_SQL_EXEC] 1111111111111@27.47.131.234:4555 msg: SQL_yielded_result, result: [clientid: 1111111111111, disconn_props: [User-Property: ], disconnected_at: 1730304110580, event: client.disconnected, metadata: [rule_id: devicestate_WH_D], node: emqx@172.17.0.2, peername: 27.47.131.234:4555, proto_name: MQTT, proto_ver: 4, reason: tcp_closed, sockname: 172.17.0.2:1883, timestamp: 1730304110580, username: oxygen001], rule_id: devicestate_WH_D, rule_trigger_ts: [1730304110580], username: oxygen001

这个 tcp_closed 应该是emqx 的对端断开的 tcp 连接,不是 emqx 主动触发的,建议自己debug一下代码。

不是很明白,我是用官方的java开发指南里的代码,另外用小程序开发(mqtt.js)的也是一样,不断断开连接,然后重连,两个都是用官方指南里的例子的,现在java代码和js两种方式都一样的问题呢。

那可以去 phao 那个库里面贴一下代码提个 issue 试试。