Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Mosquitto » Mosquitto wildcard and retain messages bug?
Mosquitto wildcard and retain messages bug? [message #1841252] Fri, 07 May 2021 21:45 Go to next message
Florent Dupont is currently offline Florent DupontFriend
Messages: 5
Registered: April 2021
Junior Member
Hi everyone,

I am observing a behaviour with wildcard and retained messages that looks like a bug to me, but I'd like someone to confirm.

I have a retained message at topic A/B/C/D/E with payload "Hello". If:
- I subscribe to topic A/B/C/D/E, I receive the message "Hello" with flag retain set to true, as expected
- I subscribe to topic A/B/C/+/#, I receive the message "Hello" with flag retain set to true, as expected
- I subscribe to topic A/B/C/#, I do not receive the retained message "Hello".
- In all 3 cases above, if I push a message to the topic A/B/C/D/E, I receive the message just fine, the problem is just with the retained messages. Given # is meant to be a wildcard working across multiple layers of topics, I am surprised by this behaviour and couldn't find anything explaining this. Is that a bug?

I run Mosquitto version 2.0.1, on docker, in case that's relevant.

Thanks.
Re: Mosquitto wildcard and retain messages bug? [message #1841461 is a reply to message #1841252] Mon, 17 May 2021 19:30 Go to previous messageGo to next message
Roger Light is currently offline Roger LightFriend
Messages: 90
Registered: September 2013
Member
Hi Florent,

That certainly would be a bug - I'm afraid I can't reproduce it though. As an example this is what I get, on Mosquitto 2.0.1 running on Ubuntu:

$ mosquitto_pub -t A/B/C/D/E -r -m Hello
$ mosquitto_sub -v -C 1 -t A/B/C/D/E
A/B/C/D/E Hello
$ mosquitto_sub -v -C 1 -t A/B/C/+/#
A/B/C/D/E Hello
$ mosquitto_sub -v -C 1 -t A/B/C/#
A/B/C/D/E Hello

Could you try the exact same procedure please? If that works, we'll work on finding out what the difference is.

Regards,

Roger
Re: Mosquitto wildcard and retain messages bug? [message #1841607 is a reply to message #1841461] Fri, 21 May 2021 20:47 Go to previous message
Florent Dupont is currently offline Florent DupontFriend
Messages: 5
Registered: April 2021
Junior Member
Apologies, I was only able to try now.

You are right, it does work for me too. It turns out the problem seems to be with NodeRed itself (this is where I noticed the misbehaviour and naively assumed this was something to do with mosquitto but I should have checked!). Lesson learned.

I'll raise it with the NodeRed team instead.

Thank you for the help.
Previous Topic:How to use only bridges without listener
Next Topic:Developing MQTT broker
Goto Forum:
  


Current Time: Thu May 02 14:22:56 GMT 2024

Powered by FUDForum. Page generated in 0.03297 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top