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

QOS 2 messages dropped by bridge. #151

Closed
andrewchambers opened this issue May 5, 2016 · 2 comments
Closed

QOS 2 messages dropped by bridge. #151

andrewchambers opened this issue May 5, 2016 · 2 comments

Comments

@andrewchambers
Copy link

andrewchambers commented May 5, 2016

I am attempted to bridge 2 brokers and subscribe to one end, and publish to the other, and can see messages are getting lost.

Steps to reproduce:

Using mosquitto version 1.4.8

1.) Run broker with settings:

port 9001
retry_interval 3
persistence true

2.) Run broker + bridge with settings:

port 9000
persistence true
retry_interval 3

connection hqbridge
restart_timeout 3
cleansession false
address 127.0.0.1:9001
topic /i/+/loads out 2
topic /i/+/hq in 2

3.) Establish a non clean subscription to bridge broker with a fixed id

 mosquitto_sub -h localhost -p 9000 -t "/i/+/hq" -c -q 2 -i i0

4.) Close subscriber from step 3. Close bridge from step 2. Now only the broker from step 1 is running.

5.) publish a message with

mosquitto_pub -h localhost -p 9001 -q 2 -t "/i/i0/hq" -m "abc"

6.) restart broker/bridge from step 2. If -v is enabled, observe it recieve the abc message.

7.) rerun subscription from step 3. Observe the message is lost.

@ralight
Copy link
Contributor

ralight commented May 5, 2016

This appears to be a bug with persisting topics that start with a /, thanks for reporting it.

You can get around it for now by removing the leading /. Honestly, there's no reason to have it there you're just complicating your hierarchy. Unlike a unix file system, / isn't the base, "" is. Using /i/i0/hq as a topic gives you four levels of hierarchy "", "i", "i0", "hq".

@andrewchambers
Copy link
Author

Thank you for looking at this so fast, and thanks for the advice.

ralight added a commit that referenced this issue May 14, 2016
Closes #151. Thanks to Andrew Chambers.

Signed-off-by: Roger A. Light <[email protected]>
@ralight ralight closed this as completed May 14, 2016
@ralight ralight added this to the 1.4.9 milestone May 19, 2016
@lock lock bot locked as resolved and limited conversation to collaborators Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants