eclipse-mosquitto / mosquitto

Eclipse Mosquitto - An open source MQTT broker
https://mosquitto.org
Other
9.13k stars 2.41k forks source link

[ISSUE] Bridge with cleansession false and long message expiry interval QoS 2 dont get the message after reconnect the bridge #3098

Open Miguel-AgRz opened 3 months ago

Miguel-AgRz commented 3 months ago

windows mosquitto 2.0.17

There is a bridge Client001:

remote_clientid MessagingBridgeClient001 address 10.0.1.32:1883 cleansession false topic RemoteEnda/+ both 2 bridge_protocol_version mqttv50 keepalive_interval 120 idle_timeout 3600

Server:

persistent_client_expiration 3m persistence true autosave_interval 100 persistence_file mosquitto.db persistence_location C:\mosquitto\

The log shows that: APP1 successfully publish a message to the Server and Server publish to the bridge everything is ok

server log: Received PUBLISH from mqttx_MKK (d0, q2, r0, m46184, 'RemoteEnda/MSG-20', ... (20 bytes)) Sending PUBLISH to MessagingBridgeClient001 (d0, q2, r0, m6, 'RemoteEnda/MSG-20', ... (20 bytes))

bridge log Received PUBLISH from local.MessagingBridgeClient001 (d0, q2, r0, m1, 'RemoteEnda/MSG-20', ... (20 bytes))

If i disconnect the bridge and publish a message (maybe the client001 were off), when the bridge is reconnected the message doesn't arrive to the bridge.

if i connect another app APP2 client directly to the Server and then disconnect, when I publish a message to the Server and then reconnect the APP2 it gets the message using clean session false. which indicates that the server is working correctly and something wrong is happening with the bridge.

Miguel-AgRz commented 3 months ago

I might found the issue if I test a APP2 sending cleansession true the CONNACK answer the same as the bridge with cleansession false:

APP2 cleansession true: Sending CONNACK to APP2 (0, 0)

APP2 cleansession false: Sending CONNACK to APP2 (1, 0)