用户退出后服务端频繁收到上下线消息

环境

  • EMQX 版本:emqx/emqx:4.4.10

  • 操作系统版本:centos8

  • docker版本: Docker version 20.10.11, build dea9396

问题

有个别用户明明没有任何和操作退出软件后emqx 却频繁收到用户上下线消息通知trace 日志如下:

  • emqx1

2023-12-19T02:12:08.344368+00:00 [debug] 10.0.0.8:59029 [MQTT] SEND PUBLISH(Q1, R0, D0Topic=xxx/server/exclusive/10029337/msg/recieve, PacketId=473, Payload={"action":"","data":{"adorn":{},"age":30,"body":"ä½ æ‰¾å¯¹è±¡è¿˜æ˜¯çŸ¥å·±","from":"13784747","fromUserName":"小沐","gender":2,"id":"1736932395313008640","image":"https://c.xxxx.com/tx/13784747/202312181003305097!s480","isAuth":"1","mobileId":"a755cf0491b140a1ab2e119cda915bbc","relation":0,"sendTime":"2023-12-19 10:12:08","subType":"1","tipsDir":0,"to":"10029337","type":"1000","voiceTime":"0"},"messageTime":1702951928343})

2023-12-19T02:12:08.544838+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV <<64,2,1,217>>

2023-12-19T02:12:08.544896+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV PUBACK(Q0, R0, D0PacketId=473, ReasonCode=0)

2023-12-19T02:12:08.544957+00:00 [debug] 10.0.0.8:59029 [WebHook] Send to: "/queue/EMQX_WEBHOOK", params: {"username":"10029337","ts":1702951928344,"topic":"xxx/server/exclusive/10029337/msg/recieve","retain":false,"qos":1,"payload":"{\"action\":\"\",\"data\":{\"adorn\":{},\"age\":30,\"body\":\"ä½ æ‰¾å¯¹è±¡è¿˜æ˜¯çŸ¥å·±\",\"from\":\"13784747\",\"fromUserName\":\"小沐\",\"gender\":2,\"id\":\"1736932395313008640\",\"image\":\"https://c.xxxx.com/tx/13784747/202312181003305097!s480\",\"isAuth\":\"1\",\"mobileId\":\"a755cf0491b140a1ab2e119cda915bbc\",\"relation\":0,\"sendTime\":\"2023-12-19 10:12:08\",\"subType\":\"1\",\"tipsDir\":0,\"to\":\"10029337\",\"type\":\"1000\",\"voiceTime\":\"0\"},\"messageTime\":1702951928343}","node":"emqx@n1.emqx.io","from_username":"admin","from_client_id":"xxx-java-mqtt1-server@paho33529652855745947","clientid":"android_10029337_246777136","action":"message_acked"}

2023-12-19T02:12:08.714743+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV <<52,101,0,54,108,105,97,110,97,105,47,115,101,114,118,101,114,47,101,120,99,108,117,115,105,118,101,47,49,55,51,54,57,51,50,51,57,53,51,49,51,48,48,56,54,52,48,47,109,115,103,47,115,116,97,116,117,115,1,147,123,34,117,105,100,34,58,34,49,48,48,50,57,51,51,55,34,44,34,105,100,34,58,49,55,51,54,57,51,50,51,57,53,51,49,51,48,48,56,54,52,48,125>>

2023-12-19T02:12:08.714825+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV PUBLISH(Q2, R0, D0Topic=xxx/server/exclusive/1736932395313008640/msg/status, PacketId=403, Payload={"uid":"10029337","id":1736932395313008640})

2023-12-19T02:12:08.715209+00:00 [info] 10.0.0.8:59029 PUBLISH to xxx/server/exclusive/1736932395313008640/msg/status: <<"{\"uid\":\"10029337\",\"id\":1736932395313008640}">>

2023-12-19T02:12:08.715248+00:00 [debug] 10.0.0.8:59029 [MQTT] SEND PUBREC(Q0, R0, D0PacketId=403, ReasonCode=16)

2023-12-19T02:12:08.804946+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV <<98,2,1,147>>

2023-12-19T02:12:08.804997+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV PUBREL(Q1, R0, D0PacketId=403, ReasonCode=0)

2023-12-19T02:12:08.805040+00:00 [debug] 10.0.0.8:59029 [MQTT] SEND PUBCOMP(Q0, R0, D0PacketId=403, ReasonCode=0)

2023-12-19T02:12:59.585648+00:00 [debug] 10.0.0.8:59029 [MQTT] SEND PUBLISH(Q1, R0, D0Topic=xxx/server/exclusive/10029337/msg/recieve, PacketId=474, Payload={"action":"","data":{"adorn":{},"age":28,"body":"https://c.xxxx.com/sx/13796392/202312182121191166","from":"13796392","fromUserName":"灵魂伴侣梦","gender":0,"id":"1736932610237538304","image":"https://c.xxxx.com/tx/13796392/202312182112151344","isAuth":"1","mobileId":"262fcbf0ee6340399466b7f0e4ce0444","relation":0,"sendTime":"2023-12-19 10:12:59","subType":"4","tips":["çˆ±ç¥žâ€œä¸˜æ¯”ç‰¹â€å‘çŽ°ä½ ä¿©ä»Šå¤©å¾ˆæœ‰ç¼˜~赶紧聊聊吧,别错过了缘分~"],"tipsDir":1,"to":"10029337","type":"1000","voiceTime":"8"},"messageTime":1702951979585})

2023-12-19T02:13:00.585635+00:00 [debug] 10.0.0.8:59029 [MQTT] SEND PUBLISH(Q1, R0, D0Topic=xxx/server/exclusive/10029337/msg/recieve, PacketId=475, Payload={"action":"","data":{"adorn":{},"age":28,"body":"{\"content\":\"ä½ å–œæ¬¢é¡¾å®¶ä¸€ç‚¹çš„ï¼Œè¿˜æ˜¯èƒ½è®©ä½ å¸¦å‡ºåŽ»æœ‰é¢å­çš„ï¼Œä½ è§‰å¾—æˆ‘å¯ä»¥å—ï¼Ÿ\"}","from":"13796392","fromUserName":"灵魂伴侣梦","gender":0,"id":"1736932614427656192","image":"https://c.xxxx.com/tx/13796392/202312182112151344","isAuth":"1","mobileId":"e6f570e158dd4ca7af44c2a940d6fcff","relation":0,"sendTime":"2023-12-19 10:13:00","subType":"32","tipsDir":0,"to":"10029337","type":"1000","voiceTime":"0"},"messageTime":1702951980584})

2023-12-19T02:13:00.705370+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV <<64,2,1,218>>

2023-12-19T02:13:00.705427+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV PUBACK(Q0, R0, D0PacketId=474, ReasonCode=0)

2023-12-19T02:13:00.705469+00:00 [debug] 10.0.0.8:59029 [WebHook] Send to: "/queue/EMQX_WEBHOOK", params: {"username":"10029337","ts":1702951979585,"topic":"xxx/server/exclusive/10029337/msg/recieve","retain":false,"qos":1,"payload":"{\"action\":\"\",\"data\":{\"adorn\":{},\"age\":28,\"body\":\"https://c.xxxx.com/sx/13796392/202312182121191166\",\"from\":\"13796392\",\"fromUserName\":\"灵魂伴侣梦\",\"gender\":0,\"id\":\"1736932610237538304\",\"image\":\"https://c.xxxx.com/tx/13796392/202312182112151344\",\"isAuth\":\"1\",\"mobileId\":\"262fcbf0ee6340399466b7f0e4ce0444\",\"relation\":0,\"sendTime\":\"2023-12-19 10:12:59\",\"subType\":\"4\",\"tips\":[\"çˆ±ç¥žâ€œä¸˜æ¯”ç‰¹â€å‘çŽ°ä½ ä¿©ä»Šå¤©å¾ˆæœ‰ç¼˜~赶紧聊聊吧,别错过了缘分~\"],\"tipsDir\":1,\"to\":\"10029337\",\"type\":\"1000\",\"voiceTime\":\"8\"},\"messageTime\":1702951979585}","node":"emqx@n1.emqx.io","from_username":"admin","from_client_id":"xxx-java-mqtt1-server@paho33530373702551366","clientid":"android_10029337_246777136","action":"message_acked"}

2023-12-19T02:13:00.825306+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV <<64,2,1,219,52,101,0,54,108,105,97,110,97,105,47,115,101,114,118,101,114,47,101,120,99,108,117,115,105,118,101,47,49,55,51,54,57,51,50,54,49,48,50,51,55,53,51,56,51,48,52,47,109,115,103,47,115,116,97,116,117,115,1,148,123,34,117,105,100,34,58,34,49,48,48,50,57,51,51,55,34,44,34,105,100,34,58,49,55,51,54,57,51,50,54,49,48,50,51,55,53,51,56,51,48,52,125>>

2023-12-19T02:13:00.825373+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV PUBACK(Q0, R0, D0PacketId=475, ReasonCode=0)

2023-12-19T02:13:00.825427+00:00 [debug] 10.0.0.8:59029 [WebHook] Send to: "/queue/EMQX_WEBHOOK", params: {"username":"10029337","ts":1702951980585,"topic":"xxx/server/exclusive/10029337/msg/recieve","retain":false,"qos":1,"payload":"{\"action\":\"\",\"data\":{\"adorn\":{},\"age\":28,\"body\":\"{\\\"content\\\":\\\"ä½ å–œæ¬¢é¡¾å®¶ä¸€ç‚¹çš„ï¼Œè¿˜æ˜¯èƒ½è®©ä½ å¸¦å‡ºåŽ»æœ‰é¢å­çš„ï¼Œä½ è§‰å¾—æˆ‘å¯ä»¥å—ï¼Ÿ\\\"}\",\"from\":\"13796392\",\"fromUserName\":\"灵魂伴侣梦\",\"gender\":0,\"id\":\"1736932614427656192\",\"image\":\"https://c.xxxx.com/tx/13796392/202312182112151344\",\"isAuth\":\"1\",\"mobileId\":\"e6f570e158dd4ca7af44c2a940d6fcff\",\"relation\":0,\"sendTime\":\"2023-12-19 10:13:00\",\"subType\":\"32\",\"tipsDir\":0,\"to\":\"10029337\",\"type\":\"1000\",\"voiceTime\":\"0\"},\"messageTime\":1702951980584}","node":"emqx@n1.emqx.io","from_username":"admin","from_client_id":"xxx-java-mqtt1-server@paho44302538332161238","clientid":"android_10029337_246777136","action":"message_acked"}

2023-12-19T02:13:00.825706+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV PUBLISH(Q2, R0, D0Topic=xxx/server/exclusive/1736932610237538304/msg/status, PacketId=404, Payload={"uid":"10029337","id":1736932610237538304})

2023-12-19T02:13:00.826086+00:00 [info] 10.0.0.8:59029 PUBLISH to xxx/server/exclusive/1736932610237538304/msg/status: <<"{\"uid\":\"10029337\",\"id\":1736932610237538304}">>

2023-12-19T02:13:00.826123+00:00 [debug] 10.0.0.8:59029 [MQTT] SEND PUBREC(Q0, R0, D0PacketId=404, ReasonCode=16)

2023-12-19T02:13:00.910134+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV <<98,2,1,148>>

2023-12-19T02:13:00.910182+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV PUBREL(Q1, R0, D0PacketId=404, ReasonCode=0)

2023-12-19T02:13:00.910211+00:00 [debug] 10.0.0.8:59029 [MQTT] SEND PUBCOMP(Q0, R0, D0PacketId=404, ReasonCode=0)

2023-12-19T02:13:00.990207+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV <<52,101,0,54,108,105,97,110,97,105,47,115,101,114,118,101,114,47,101,120,99,108,117,115,105,118,101,47,49,55,51,54,57,51,50,54,49,52,52,50,55,54,53,54,49,57,50,47,109,115,103,47,115,116,97,116,117,115,1,149,123,34,117,105,100,34,58,34,49,48,48,50,57,51,51,55,34,44,34,105,100,34,58,49,55,51,54,57,51,50,54,49,52,52,50,55,54,53,54,49,57,50,125>>

2023-12-19T02:13:00.990260+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV PUBLISH(Q2, R0, D0Topic=xxx/server/exclusive/1736932614427656192/msg/status, PacketId=405, Payload={"uid":"10029337","id":1736932614427656192})

2023-12-19T02:13:00.990601+00:00 [info] 10.0.0.8:59029 PUBLISH to xxx/server/exclusive/1736932614427656192/msg/status: <<"{\"uid\":\"10029337\",\"id\":1736932614427656192}">>

2023-12-19T02:13:00.990641+00:00 [debug] 10.0.0.8:59029 [MQTT] SEND PUBREC(Q0, R0, D0PacketId=405, ReasonCode=16)

2023-12-19T02:13:01.074335+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV <<98,2,1,149>>

2023-12-19T02:13:01.074371+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV PUBREL(Q1, R0, D0PacketId=405, ReasonCode=0)

2023-12-19T02:13:01.074393+00:00 [debug] 10.0.0.8:59029 [MQTT] SEND PUBCOMP(Q0, R0, D0PacketId=405, ReasonCode=0)

2023-12-19T02:13:01.585869+00:00 [debug] 10.0.0.8:59029 [MQTT] SEND PUBLISH(Q1, R0, D0Topic=xxx/server/exclusive/10029337/msg/recieve, PacketId=476, Payload={"action":"","data":{"adorn":{},"age":28,"body":"https://c.xxxx.com/dzh/13796392/202312182126082084","from":"13796392","fromUserName":"灵魂伴侣梦","gender":0,"id":"1736932618626150400","image":"https://c.xxxx.com/tx/13796392/202312182112151344","isAuth":"1","mobileId":"9b9e7ddd2977450ab26c3e711f5752a4","relation":0,"sendTime":"2023-12-19 10:13:01","subType":"2","tipsDir":0,"to":"10029337","type":"1000","voiceTime":"0"},"messageTime":1702951981585})

2023-12-19T02:13:01.690393+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV <<64,2,1,220>>

2023-12-19T02:13:01.690442+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV PUBACK(Q0, R0, D0PacketId=476, ReasonCode=0)

2023-12-19T02:13:01.690498+00:00 [debug] 10.0.0.8:59029 [WebHook] Send to: "/queue/EMQX_WEBHOOK", params: {"username":"10029337","ts":1702951981586,"topic":"xxx/server/exclusive/10029337/msg/recieve","retain":false,"qos":1,"payload":"{\"action\":\"\",\"data\":{\"adorn\":{},\"age\":28,\"body\":\"https://c.xxxx.com/dzh/13796392/202312182126082084\",\"from\":\"13796392\",\"fromUserName\":\"灵魂伴侣梦\",\"gender\":0,\"id\":\"1736932618626150400\",\"image\":\"https://c.xxxx.com/tx/13796392/202312182112151344\",\"isAuth\":\"1\",\"mobileId\":\"9b9e7ddd2977450ab26c3e711f5752a4\",\"relation\":0,\"sendTime\":\"2023-12-19 10:13:01\",\"subType\":\"2\",\"tipsDir\":0,\"to\":\"10029337\",\"type\":\"1000\",\"voiceTime\":\"0\"},\"messageTime\":1702951981585}","node":"emqx@n1.emqx.io","from_username":"admin","from_client_id":"xxx-java-mqtt1-server@paho44303087883452212","clientid":"android_10029337_246777136","action":"message_acked"}

2023-12-19T02:13:01.810108+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV <<52,101,0,54,108,105,97,110,97,105,47,115,101,114,118,101,114,47,101,120,99,108,117,115,105,118,101,47,49,55,51,54,57,51,50,54,49,56,54,50,54,49,53,48,52,48,48,47,109,115,103,47,115,116,97,116,117,115,1,150,123,34,117,105,100,34,58,34,49,48,48,50,57,51,51,55,34,44,34,105,100,34,58,49,55,51,54,57,51,50,54,49,56,54,50,54,49,53,48,52,48,48,125>>

2023-12-19T02:13:01.810178+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV PUBLISH(Q2, R0, D0Topic=xxx/server/exclusive/1736932618626150400/msg/status, PacketId=406, Payload={"uid":"10029337","id":1736932618626150400})

2023-12-19T02:13:01.810544+00:00 [info] 10.0.0.8:59029 PUBLISH to xxx/server/exclusive/1736932618626150400/msg/status: <<"{\"uid\":\"10029337\",\"id\":1736932618626150400}">>

2023-12-19T02:13:01.810576+00:00 [debug] 10.0.0.8:59029 [MQTT] SEND PUBREC(Q0, R0, D0PacketId=406, ReasonCode=16)

2023-12-19T02:13:01.888479+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV <<98,2,1,150>>

2023-12-19T02:13:01.888523+00:00 [debug] 10.0.0.8:59029 [MQTT] RECV PUBREL(Q1, R0, D0PacketId=406, ReasonCode=0)

2023-12-19T02:13:01.888552+00:00 [debug] 10.0.0.8:59029 [MQTT] SEND PUBCOMP(Q0, R0, D0PacketId=406, ReasonCode=0)

2023-12-19T02:14:58.927746+00:00 [debug] 10.0.0.8:59029 [MQTT] Force to close the socket due to keepalive_timeout

2023-12-19T02:14:58.928202+00:00 [warning] 10.0.0.8:59029 msg: last_will_testament_publish_denied

topic: <<"xxx/client/exclusive/10029337/status">>

2023-12-19T02:14:58.928272+00:00 [debug] 10.0.0.8:59029 [WebHook] Send to: "/queue/EMQX_WEBHOOK", params: {"username":"10029337","reason":"keepalive_timeout","node":"emqx@n1.emqx.io","disconnected_at":1702952098928,"connected_at":1702951378911,"clientid":"android_10029337_246777136","action":"client_disconnected"}

2023-12-19T02:15:01.157972+00:00 [debug] 10.0.0.8:39371 [Channel] RECV CONNECT(Q0, R0, D0ClientId=android_10029337_246777136, ProtoName=MQTT, ProtoVsn=4, CleanStart=false, KeepAlive=60, Username=10029337, Password=******, Will(Q2, R1, Topic=xxx/client/exclusive/10029337/status, Payload=<<"{\"data\":{\"status\":0,\"userId\":10029337},\"messageTime\":1702928947374}">>))

2023-12-19T02:15:01.158501+00:00 [info] 10.0.0.8:39371 android_10029337_246777136 SUBSCRIBE xxx/server/broadcast/app: Options: #{nl => 0,qos => 2,rap => 0,rh => 0,sub_props => #{}}

2023-12-19T02:15:01.158637+00:00 [info] 10.0.0.8:39371 android_10029337_246777136 SUBSCRIBE xxx/server/exclusive/10029337/msg/0/recieve: Options: #{nl => 0,qos => 0,rap => 0,rh => 0,sub_props => #{}}

2023-12-19T02:15:01.158705+00:00 [info] 10.0.0.8:39371 android_10029337_246777136 SUBSCRIBE xxx/server/exclusive/10029337/msg/recieve: Options: #{nl => 0,qos => 2,rap => 0,rh => 0,sub_props => #{}}

2023-12-19T02:15:01.158755+00:00 [info] 10.0.0.8:39371 android_10029337_246777136 SUBSCRIBE xxx/server/exclusive/10029337/one2one/bizControl: Options: #{nl => 0,qos => 2,rap => 0,rh => 0,sub_props => #{}}

2023-12-19T02:15:01.158817+00:00 [info] 10.0.0.8:59029 android_10029337_246777136 UNSUBSCRIBE xxx/server/broadcast/app: Options: #{nl => 0,qos => 2,rap => 0,rh => 0,shard => 77,sub_props => #{},subid => <<"android_10029337_246777136">>}

2023-12-19T02:15:01.158869+00:00 [info] 10.0.0.8:59029 android_10029337_246777136 UNSUBSCRIBE xxx/server/exclusive/10029337/msg/0/recieve: Options: #{nl => 0,qos => 0,rap => 0,rh => 0,sub_props => #{},subid => <<"android_10029337_246777136">>}

2023-12-19T02:15:01.158927+00:00 [info] 10.0.0.8:59029 android_10029337_246777136 UNSUBSCRIBE xxx/server/exclusive/10029337/msg/recieve: Options: #{nl => 0,qos => 2,rap => 0,rh => 0,sub_props => #{},subid => <<"android_10029337_246777136">>}

2023-12-19T02:15:01.159022+00:00 [info] 10.0.0.8:59029 android_10029337_246777136 UNSUBSCRIBE xxx/server/exclusive/10029337/one2one/bizControl: Options: #{nl => 0,qos => 2,rap => 0,rh => 0,sub_props => #{},subid => <<"android_10029337_246777136">>}

2023-12-19T02:15:01.159060+00:00 [debug] 10.0.0.8:59029 clientid: <<"android_10029337_246777136">>

msg: emqx_channel_takeover_end

2023-12-19T02:15:01.159094+00:00 [info] 10.0.0.8:59029 msg: terminate

reason: {shutdown,takeovered}

2023-12-19T02:15:01.159387+00:00 [debug] 10.0.0.8:39371 [WebHook] Send to: "/queue/EMQX_WEBHOOK", params: {"username":"10029337","proto_ver":4,"node":"emqx@n1.emqx.io","keepalive":60,"ipaddress":"10.0.0.8","connected_at":1702952101159,"clientid":"android_10029337_246777136","action":"client_connected"}

2023-12-19T02:15:01.159864+00:00 [debug] 10.0.0.8:39371 client_id: <<"android_10029337_246777136">>

msg: insert_channel_info

2023-12-19T02:15:01.159910+00:00 [debug] 10.0.0.8:39371 [MQTT] SEND CONNACK(Q0, R0, D0AckFlags=1, ReasonCode=0)

2023-12-19T02:15:01.170366+00:00 [debug] 10.0.0.8:39371 [MQTT] SEND PUBLISH(Q1, R0, D0Topic=xxx/server/exclusive/10029337/msg/recieve, PacketId=477, Payload={"action":"","data":{"body":{"clientId":"android_10029337_246777136","text":"登录已失效,请重新登录-1","title":"登录失效","type":0,"uid":0},"sendTime":"2023-12-19 10:15:01","subType":0,"type":5000},"messageTime":1702952101170})

2023-12-19T02:15:01.436983+00:00 [debug] 10.0.0.8:39371 [MQTT] RECV <<64,2,1,221>>

2023-12-19T02:15:01.437030+00:00 [debug] 10.0.0.8:39371 [MQTT] RECV PUBACK(Q0, R0, D0PacketId=477, ReasonCode=0)

2023-12-19T02:15:01.437079+00:00 [debug] 10.0.0.8:39371 [WebHook] Send to: "/queue/EMQX_WEBHOOK", params: {"username":"10029337","ts":1702952101170,"topic":"xxx/server/exclusive/10029337/msg/recieve","retain":false,"qos":1,"payload":"{\"action\":\"\",\"data\":{\"body\":{\"clientId\":\"android_10029337_246777136\",\"text\":\"登录已失效,请重新登录-1\",\"title\":\"登录失效\",\"type\":0,\"uid\":0},\"sendTime\":\"2023-12-19 10:15:01\",\"subType\":0,\"type\":5000},\"messageTime\":1702952101170}","node":"emqx@n1.emqx.io","from_username":"admin","from_client_id":"xxx-java-mqtt1-server@paho44303087883452212","clientid":"android_10029337_246777136","action":"message_acked"}

2023-12-19T02:15:14.003515+00:00 [debug] 10.0.0.8:39371 [MQTT] SEND PUBLISH(Q1, R0, D0Topic=xxx/server/exclusive/10029337/msg/recieve, PacketId=478, Payload={"action":"","data":{"adorn":{},"age":37,"body":"https://c.xxxx.com/sx/633915/202311291650448103","from":"633915","fromUserName":"æ¢¦ç¼˜å¯»ä½ ","gender":0,"id":"1736933174023307264","image":"https://c.xxxx.com/tx/633915/202206151952468035!s480","isAuth":"1","mobileId":"f204e6ff323f46fbb9d9691c74ab7ea8","relation":0,"sendTime":"2023-12-19 10:15:14","subType":"4","tips":["çˆ±ç¥žâ€œä¸˜æ¯”ç‰¹â€å‘çŽ°ä½ ä¿©ä»Šå¤©å¾ˆæœ‰ç¼˜~赶紧聊聊吧,别错过了缘分~"],"tipsDir":1,"to":"10029337","type":"1000","voiceTime":"5"},"messageTime":1702952114002})

2023-12-19T02:15:14.337134+00:00 [debug] 10.0.0.8:39371 [MQTT] RECV <<64,2,1,222>>

2023-12-19T02:15:14.337193+00:00 [debug] 10.0.0.8:39371 [MQTT] RECV PUBACK(Q0, R0, D0PacketId=478, ReasonCode=0)

2023-12-19T02:15:14.337241+00:00 [debug] 10.0.0.8:39371 [WebHook] Send to: "/queue/EMQX_WEBHOOK", params: {"username":"10029337","ts":1702952114003,"topic":"xxx/server/exclusive/10029337/msg/recieve","retain":false,"qos":1,"payload":"{\"action\":\"\",\"data\":{\"adorn\":{},\"age\":37,\"body\":\"https://c.xxxx.com/sx/633915/202311291650448103\",\"from\":\"633915\",\"fromUserName\":\"æ¢¦ç¼˜å¯»ä½ \",\"gender\":0,\"id\":\"1736933174023307264\",\"image\":\"https://c.xxxx.com/tx/633915/202206151952468035!s480\",\"isAuth\":\"1\",\"mobileId\":\"f204e6ff323f46fbb9d9691c74ab7ea8\",\"relation\":0,\"sendTime\":\"2023-12-19 10:15:14\",\"subType\":\"4\",\"tips\":[\"çˆ±ç¥žâ€œä¸˜æ¯”ç‰¹â€å‘çŽ°ä½ ä¿©ä»Šå¤©å¾ˆæœ‰ç¼˜~赶紧聊聊吧,别错过了缘分~\"],\"tipsDir\":1,\"to\":\"10029337\",\"type\":\"1000\",\"voiceTime\":\"5\"},\"messageTime\":1702952114002}","node":"emqx@n1.emqx.io","from_username":"admin","from_client_id":"xxx-java-mqtt1-server@paho44302538332161238","clientid":"android_10029337_246777136","action":"message_acked"}

2023-12-19T02:15:14.577083+00:00 [debug] 10.0.0.8:39371 [MQTT] RECV <<52,101,0,54,108,105,97,110,97,105,47,115,101,114,118,101,114,47,101,120,99,108,117,115,105,118,101,47,49,55,51,54,57,51,51,49,55,52,48,50,51,51,48,55,50,54,52,47,109,115,103,47,115,116,97,116,117,115,1,151,123,34,117,105,100,34,58,34,49,48,48,50,57,51,51,55,34,44,34,105,100,34,58,49,55,51,54,57,51,51,49,55,52,48,50,51,51,48,55,50,54,52,125>>

2023-12-19T02:15:14.577146+00:00 [debug] 10.0.0.8:39371 [MQTT] RECV PUBLISH(Q2, R0, D0Topic=xxx/server/exclusive/1736933174023307264/msg/status, PacketId=407, Payload={"uid":"10029337","id":1736933174023307264})

2023-12-19T02:15:14.577468+00:00 [info] 10.0.0.8:39371 PUBLISH to xxx/server/exclusive/1736933174023307264/msg/status: <<"{\"uid\":\"10029337\",\"id\":1736933174023307264}">>

2023-12-19T02:15:14.577511+00:00 [debug] 10.0.0.8:39371 [MQTT] SEND PUBREC(Q0, R0, D0PacketId=407, ReasonCode=16)

2023-12-19T02:15:14.927211+00:00 [debug] 10.0.0.8:39371 [MQTT] RECV <<98,2,1,151>>

2023-12-19T02:15:14.927271+00:00 [debug] 10.0.0.8:39371 [MQTT] RECV PUBREL(Q1, R0, D0PacketId=407, ReasonCode=0)

2023-12-19T02:15:14.927300+00:00 [debug] 10.0.0.8:39371 [MQTT] SEND PUBCOMP(Q0, R0, D0PacketId=407, ReasonCode=0)

2023-12-19T02:15:15.003796+00:00 [debug] 10.0.0.8:39371 [MQTT] SEND PUBLISH(Q1, R0, D0Topic=xxx/server/exclusive/10029337/msg/recieve, PacketId=479, Payload={"action":"","data":{"adorn":{},"age":37,"body":"{\"content\":\"æœ‰ç¼˜ç›¸è¯†ï¼Œèƒ½å¦è§†é¢‘è§ä½ ä¸€é¢ï¼Ÿ\"}","from":"633915","fromUserName":"æ¢¦ç¼˜å¯»ä½ ","gender":0,"id":"1736933178217611264","image":"https://c.xxxx.com/tx/633915/202206151952468035!s480","isAuth":"1","mobileId":"e6fa569d91dc4072a329b4f55c8cdedd","relation":0,"sendTime":"2023-12-19 10:15:15","subType":"32","tipsDir":0,"to":"10029337","type":"1000","voiceTime":"0"},"messageTime":1702952115002})

2023-12-19T02:15:15.292431+00:00 [debug] 10.0.0.8:39371 [MQTT] RECV <<64,2,1,223>>

2023-12-19T02:15:15.292477+00:00 [debug] 10.0.0.8:39371 [MQTT] RECV PUBACK(Q0, R0, D0PacketId=479, ReasonCode=0)

2023-12-19T02:15:15.292521+00:00 [debug] 10.0.0.8:39371 [WebHook] Send to: "/queue/EMQX_WEBHOOK", params: {"username":"10029337","ts":1702952115003,"topic":"xxx/server/exclusive/10029337/msg/recieve","retain":false,"qos":1,"payload":"{\"action\":\"\",\"data\":{\"adorn\":{},\"age\":37,\"body\":\"{\\\"content\\\":\\\"æœ‰ç¼˜ç›¸è¯†ï¼Œèƒ½å¦è§†é¢‘è§ä½ ä¸€é¢ï¼Ÿ\\\"}\",\"from\":\"633915\",\"fromUserName\":\"æ¢¦ç¼˜å¯»ä½ \",\"gender\":0,\"id\":\"1736933178217611264\",\"image\":\"https://c.xxxx.com/tx/633915/202206151952468035!s480\",\"isAuth\":\"1\",\"mobileId\":\"e6fa569d91dc4072a329b4f55c8cdedd\",\"relation\":0,\"sendTime\":\"2023-12-19 10:15:15\",\"subType\":\"32\",\"tipsDir\":0,\"to\":\"10029337\",\"type\":\"1000\",\"voiceTime\":\"0\"},\"messageTime\":1702952115002}","node":"emqx@n1.emqx.io","from_username":"admin","from_client_id":"xxx-java-mqtt1-server@paho44302538332161238","clientid":"android_10029337_246777136","action":"message_acked"}

2023-12-19T02:15:15.772314+00:00 [debug] 10.0.0.8:39371 [MQTT] RECV <<52,101,0,54,108,105,97,110,97,105,47,115,101,114,118,101,114,47,101,120,99,108,117,115,105,118,101,47,49,55,51,54,57,51,51,49,55,56,50,49,55,54,49,49,50,54,52,47,109,115,103,47,115,116,97,116,117,115,1,152,123,34,117,105,100,34,58,34,49,48,48,50,57,51,51,55,34,44,34,105,100,34,58,49,55,51,54,57,51,51,49,55,56,50,49,55,54,49,49,50,54,52,125>>

2023-12-19T02:15:15.772396+00:00 [debug] 10.0.0.8:39371 [MQTT] RECV PUBLISH(Q2, R0, D0Topic=xxx/server/exclusive/1736933178217611264/msg/status, PacketId=408, Payload={"uid":"10029337","id":1736933178217611264})

2023-12-19T02:15:15.772758+00:00 [info] 10.0.0.8:39371 PUBLISH to xxx/server/exclusive/1736933178217611264/msg/status: <<"{\"uid\":\"10029337\",\"id\":1736933178217611264}">>

2023-12-19T02:15:15.772799+00:00 [debug] 10.0.0.8:39371 [MQTT] SEND PUBREC(Q0, R0, D0PacketId=408, ReasonCode=16)

2023-12-19T02:15:15.896963+00:00 [debug] 10.0.0.8:39371 [MQTT] RECV <<98,2,1,152>>

2023-12-19T02:15:15.897002+00:00 [debug] 10.0.0.8:39371 [MQTT] RECV PUBREL(Q1, R0, D0PacketId=408, ReasonCode=0)

2023-12-19T02:15:15.897030+00:00 [debug] 10.0.0.8:39371 [MQTT] SEND PUBCOMP(Q0, R0, D0PacketId=408, ReasonCode=0)

2023-12-19T02:16:26.372066+00:00 [debug] 10.0.0.8:39371 [MQTT] SEND PUBLISH(Q1, R0, D0Topic=xxx/server/exclusive/10029337/msg/recieve, PacketId=480, Payload={"action":"","data":{"adorn":{},"age":31,"body":"{\"content\":\"哈喽\"}","from":"13811018","fromUserName":"沐夏","gender":0,"id":"1736933477565075456","image":"https://c.xxxx.com/tx/13811018/202312190952561902","isAuth":"1","mobileId":"6a1bd100a3a147d19efe58547ebd3fcf","relation":0,"sendTime":"2023-12-19 10:16:26","subType":"32","tips":["çˆ±ç¥žâ€œä¸˜æ¯”ç‰¹â€å‘çŽ°ä½ ä¿©ä»Šå¤©å¾ˆæœ‰ç¼˜~赶紧聊聊吧,别错过了缘分~"],"tipsDir":1,"to":"10029337","type":"1000","voiceTime":"0"},"messageTime":1702952186372})

2023-12-19T02:16:26.788094+00:00 [debug] 10.0.0.8:39371 [MQTT] RECV <<64,2,1,224>>

2023-12-19T02:16:26.788143+00:00 [debug] 10.0.0.8:39371 [MQTT] RECV PUBACK(Q0, R0, D0PacketId=480, ReasonCode=0)

2023-12-19T02:16:26.788192+00:00 [debug] 10.0.0.8:39371 [WebHook] Send to: "/queue/EMQX_WEBHOOK", params: {"username":"10029337","ts":1702952186372,"topic":"xxx/server/exclusive/10029337/msg/recieve","retain":false,"qos":1,"payload":"{\"action\":\"\",\"data\":{\"adorn\":{},\"age\":31,\"body\":\"{\\\"content\\\":\\\"哈喽\\\"}\",\"from\":\"13811018\",\"fromUserName\":\"沐夏\",\"gender\":0,\"id\":\"1736933477565075456\",\"image\":\"https://c.xxxx.com/tx/13811018/202312190952561902\",\"isAuth\":\"1\",\"mobileId\":\"6a1bd100a3a147d19efe58547ebd3fcf\",\"relation\":0,\"sendTime\":\"2023-12-19 10:16:26\",\"subType\":\"32\",\"tips\":[\"çˆ±ç¥žâ€œä¸˜æ¯”ç‰¹â€å‘çŽ°ä½ ä¿©ä»Šå¤©å¾ˆæœ‰ç¼˜~赶紧聊聊吧,别错过了缘分~\"],\"tipsDir\":1,\"to\":\"10029337\",\"type\":\"1000\",\"voiceTime\":\"0\"},\"messageTime\":1702952186372}","node":"emqx@n1.emqx.io","from_username":"admin","from_client_id":"xxx-java-mqtt1-server@paho33529652855745947","clientid":"android_10029337_246777136","action":"message_acked"}

2023-12-19T02:16:27.204365+00:00 [debug] 10.0.0.8:39371 [MQTT] RECV <<52,101,0,54,108,105,97,110,97,105,47,115,101,114,118,101,114,47,101,120,99,108,117,115,105,118,101,47,49,55,51,54,57,51,51,52,55,55,53,54,53,48,55,53,52,53,54,47,109,115,103,47,115,116,97,116,117,115,1,153,123,34,117,105,100,34,58,34,49,48,48,50,57,51,51,55,34,44,34,105,100,34,58,49,55,51,54,57,51,51,52,55,55,53,54,53,48,55,53,52,53,54,125>>

2023-12-19T02:16:27.204425+00:00 [debug] 10.0.0.8:39371 [MQTT] RECV PUBLISH(Q2, R0, D0Topic=xxx/server/exclusive/1736933477565075456/msg/status, PacketId=409, Payload={"uid":"10029337","id":1736933477565075456})

2023-12-19T02:16:27.204777+00:00 [info] 10.0.0.8:39371 PUBLISH to xxx/server/exclusive/1736933477565075456/msg/status: <<"{\"uid\":\"10029337\",\"id\":1736933477565075456}">>

2023-12-19T02:16:27.204806+00:00 [debug] 10.0.0.8:39371 [MQTT] SEND PUBREC(Q0, R0, D0PacketId=409, ReasonCode=16)

2023-12-19T02:16:27.380217+00:00 [debug] 10.0.0.8:39371 [MQTT] RECV <<98,2,1,153>>

2023-12-19T02:16:27.380261+00:00 [debug] 10.0.0.8:39371 [MQTT] RECV PUBREL(Q1, R0, D0PacketId=409, ReasonCode=0)

2023-12-19T02:16:27.380287+00:00 [debug] 10.0.0.8:39371 [MQTT] SEND PUBCOMP(Q0, R0, D0PacketId=409, ReasonCode=0)

2023-12-19T02:18:01.163744+00:00 [debug] 10.0.0.8:39371 [MQTT] Force to close the socket due to keepalive_timeout

2023-12-19T02:18:01.164254+00:00 [warning] 10.0.0.8:39371 msg: last_will_testament_publish_denied

topic: <<"xxx/client/exclusive/10029337/status">>

2023-12-19T02:18:01.164334+00:00 [debug] 10.0.0.8:39371 [WebHook] Send to: "/queue/EMQX_WEBHOOK", params: {"username":"10029337","reason":"keepalive_timeout","node":"emqx@n1.emqx.io","disconnected_at":1702952281164,"connected_at":1702952101159,"clientid":"android_10029337_246777136","action":"client_disconnected"}

2023-12-19T02:18:05.215077+00:00 [info] 10.0.0.8:39371 android_10029337_246777136 UNSUBSCRIBE xxx/server/broadcast/app: Options: #{nl => 0,qos => 2,rap => 0,rh => 0,shard => 123,sub_props => #{},subid => <<"android_10029337_246777136">>}

2023-12-19T02:18:05.215142+00:00 [info] 10.0.0.8:39371 android_10029337_246777136 UNSUBSCRIBE xxx/server/exclusive/10029337/msg/0/recieve: Options: #{nl => 0,qos => 0,rap => 0,rh => 0,sub_props => #{},subid => <<"android_10029337_246777136">>}

2023-12-19T02:18:05.215174+00:00 [info] 10.0.0.8:39371 android_10029337_246777136 UNSUBSCRIBE xxx/server/exclusive/10029337/msg/recieve: Options: #{nl => 0,qos => 2,rap => 0,rh => 0,sub_props => #{},subid => <<"android_10029337_246777136">>}

2023-12-19T02:18:05.215230+00:00 [info] 10.0.0.8:39371 android_10029337_246777136 UNSUBSCRIBE xxx/server/exclusive/10029337/one2one/bizControl: Options: #{nl => 0,qos => 2,rap => 0,rh => 0,sub_props => #{},subid => <<"android_10029337_246777136">>}

2023-12-19T02:18:05.215268+00:00 [debug] 10.0.0.8:39371 clientid: <<"android_10029337_246777136">>

msg: emqx_channel_takeover_end

2023-12-19T02:18:05.215304+00:00 [info] 10.0.0.8:39371 msg: terminate

reason: {shutdown,takeovered}

客户端使用同样的 clientid 再次连接, takenover 拿了之前的 session

客户端直接断开,但没有正常发送 DISCONNECT 报文,EMQX 在通过 keepalive 等机制判断客户端已下线之前,客户端就重新发送了 CONNECT 报文进行连接

可参考另一篇帖子中的回答:为什么一个设备会在很短的时间内订阅又取消订阅又订阅主题