eclipse-paho / eclipse-paho/paho.mqtt.java
Unexpected behavior while using single level wildcard + for the subscriber application.
- Dominant language
- Java
- Stars
- 2.3k
- Forks
- 919
- PR merge metrics
- No merged PRs in 30d
Description
We are connecting to HiveMQ cluster using paho client V5 i.e org.eclipse.paho.mqttv5.client-1.2.5.jar.
While we were evaluating the multi level wildcard feature for the subscriber we observed a discrepancy in behavior.
Here is a short descripton of the use case:
Expected: The + wildcard in MQTT should match only one topic level. So, a subscription to **_sport/tennis/+_** should not match a published topic like sport/tennis/2023/team, as it contains two levels after sport/tennis/. Only sport/tennis/2023 should match when + is used after sport/tennis.
Reference links:
https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901245
https://www.hivemq.com/blog/mqtt-essentials-part-5-mqtt-topics-best-practices
Actual behavior :
when topic name for the subscriber is used as **_sport/tennis/+_** and the message is published to sport/tennis/2023/team, then the subscriber still receives this message.
Could this be a valid item for a defect? Please let us know if any additional information is required. FYI, we register a callback to receive the messages.
Contributor guide
Research direction
Start by reproducing the report with org.eclipse.paho.mqttv5.client-1.2.5.jar, a subscription to sport/tennis/+, a publication to sport/tennis/2023/team, and the registered callback. Trace the subscription matching behavior and compare it with the MQTT v5 wildcard rule; done means the callback does not receive the two-level topic while still receiving sport/tennis/2023.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100