Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After v1.5.4: bridge doesn't queue up messages when connection not active #1174

Closed
beville opened this issue Feb 18, 2019 · 4 comments
Closed
Milestone

Comments

@beville
Copy link

beville commented Feb 18, 2019

We have a mobile device, using a cell modem for network connectivity. We are currently using mosquitto 1.5.1 to act a bridge to the remote broker. The idea is that local MQTT client apps can connect exclusively to the local bridge, and don't worry about mobile connectivity. We'd like to keep our version of mosquitto up to date, but have run into a problem. Here's what we see with regards to the bridge handing messages when connectivity is down.


With 1.5.1 this works fine. The sequence I see is this:

  1. Mosquitto starts up, reads the config which has this line under the bridge section:
    topic device/intro out 1 "" ""
  2. Mosquitto seems to subscribe to the topic 'device/intro' immediately:
    mosquitto[1195]: Bridge local.device.bridge doing local SUBSCRIBE on topic device/intro
  3. Client connects, and publishes message with topic 'device/intro', and mosquitto queues it up.
  4. Data connection is established, and the device has an IP address on cell network.
  5. Mosquitto connects to remote broker
  6. Mosquitto publishes 'device/intro' message

This above seems true up to version 1.5.4.


From 1.5.5 on, this is what I see:

  1. Mosquitto starts up, reads the config which has this line under the bridge section:
    topic device/intro out 1 "" ""
  2. Client connects, and publishes message with topic 'device/intro'
  3. Data connection is established, and the device has an IP address on cell network.
  4. Mosquitto connects to remote broker
  5. Mosquitto seems to subscribe to the topic 'device/intro':
    mosquitto[1195]: Bridge local.device.bridge doing local SUBSCRIBE on topic device/intro
  6. Mosquitto does not publish 'device/intro' message

So it appears that the message is now being discarded because of the timing of the subscription relative to the connection the remote broker. It seems like the bridge shouldn't be discarding any configured outgoing message topics regardless of current connectivity.

@ralight
Copy link
Contributor

ralight commented Feb 19, 2019

Thanks, I'll take a look (I'm currently traveling though). Could you just confirming what platform you are running on?

@beville
Copy link
Author

beville commented Feb 19, 2019

Linux, on an arm7.

I'm pretty the change is related to this commit: 464b12f

Some other info, config for the bridge has cleansession=false, and test messages are QoS=1

@ralight
Copy link
Contributor

ralight commented Feb 28, 2019

I've added some tests and a fix, and intend to make a release today.

@ralight ralight added this to the 1.5.8 milestone Feb 28, 2019
@beville
Copy link
Author

beville commented Feb 28, 2019

Fantastic, thanks for addressing this so quickly!

karlp added a commit to openwrt/packages that referenced this issue Mar 27, 2019
Full changelog available at:
https://github.com/eclipse/mosquitto/blob/v1.5.8/ChangeLog.txt

This is a bugfix release.  Of likely note to OpenWrt is a bug affecting
missing messages on bridges since 1.5.4:
eclipse/mosquitto#1174

Signed-off-by: Karl Palsson <[email protected]>
karlp added a commit to openwrt/packages that referenced this issue Mar 27, 2019
Full changelog available at:
https://github.com/eclipse/mosquitto/blob/v1.5.8/ChangeLog.txt

This is a bugfix release.  Of likely note to OpenWrt is a bug affecting
missing messages on bridges since 1.5.4:
eclipse/mosquitto#1174

Signed-off-by: Karl Palsson <[email protected]>
thiagoricciardi pushed a commit to thiagoricciardi/packages that referenced this issue Apr 3, 2019
Full changelog available at:
https://github.com/eclipse/mosquitto/blob/v1.5.8/ChangeLog.txt

This is a bugfix release.  Of likely note to OpenWrt is a bug affecting
missing messages on bridges since 1.5.4:
eclipse/mosquitto#1174

Signed-off-by: Karl Palsson <[email protected]>
srchack pushed a commit to srchack/packages that referenced this issue Apr 25, 2019
Full changelog available at:
https://github.com/eclipse/mosquitto/blob/v1.5.8/ChangeLog.txt

This is a bugfix release.  Of likely note to OpenWrt is a bug affecting
missing messages on bridges since 1.5.4:
eclipse/mosquitto#1174

Signed-off-by: Karl Palsson <[email protected]>
@lock lock bot locked as resolved and limited conversation to collaborators Aug 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants