eclipse / mosquitto

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

develop: mqttv5: bridge clean session false doesn't work #1632

Open karlp opened 4 years ago

karlp commented 4 years ago

Only applicable to the develop branch, where bridge connection protocol has been added.

Clean session false is set, but without setting a non-zero session expiry, it's still effectively treated as clean session.

This is in src/bridge.c where it calls rc2 = send__connect(context, context->keepalive, context->clean_start, NULL); with NULL for the properties.

I'm not sure what the correct behaviour here is. At a minimum, I presume a method of setting arbitrary v5 props on bridges is required, then either...

Example configs for testing:

 cat ../mosquitto/test/broker/06-bridge-clean-session2_a_edge.conf
port 1888

persistence true
persistence_file 06-bridge-clean-session2_a_edge.db

connection bridge_sample
address 127.0.0.1:1889
topic br_out/# out 1
topic br_in/# in 1
notifications false
keepalive_interval 5
restart_timeout 5
cleansession false
#local_cleansession false
bridge_protocol_version mqttv50

and

$ cat ../mosquitto/test/broker/06-bridge-clean-session2_b_core.conf
port 1889

persistence true
persistence_file 06-bridge-clean-session2_b_core.db

Subscribe to "edge" broker,

$ mosquitto_sub -t "#" -d -p 1888 -c -i hohoaaaa -V mqttv5

Then

  1. publish to core broker (br_in/blah)
  2. see it on the subscriber
  3. terminate edge broker 4 publish to core again (should be queued)
  4. restart edge broker
  5. publish to core again 7 witness queued message is missing, only messages 1 and 6 have arrived.
JSchy65 commented 7 months ago

See https://github.com/eclipse/mosquitto/issues/2980 "Feature Request: Expand bridge with Session Expiry Interval (MQTT 5.0)"

Miguel-AgRz commented 2 weeks ago

any update on this issue? i would like to connect my bridge with v5 but my use case must reconnect and get missed messages while the bridge was offline.