-
Notifications
You must be signed in to change notification settings - Fork 899
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
Callbacks not invoked for shared-subscriptions #367
Comments
Great explanation in the issue. We are also facing similar issue. Upon checking further I found out that in CommsCallback's Should I go ahead and add support for external topic matcher in CommsCallback? If no external topic matcher registered then default to The issue was notified in emqttd broker as well: emqx/emqx#921 |
As @yogin16 says, Shared Subscriptions aren't in the MQTT 3.1.1 specification, there are some guidelines on topics starting with $ though (http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718108). I'm hesitant about adding things that would take us off specification as it feels like a bit of a slippery slope. MQTTv5 will include shared subscriptions and we will definitely be implementing them in the Paho Java v5 client. Whether we add it to the 3.1.1 client though is something that I think should be discussed with the wider Paho community. |
I was able to solve this by adding a MqttCallback implementation for custom routing of unmatched topic filter. Here is the example: https://github.com/yogin16/paho-shared-sub-example/blob/master/example/src/src/SharedSubCallbackRouter.java |
We could have a method on the client (for MQTT V3 - MQTT V5 has it in the spec), which gives a list of prefixes (in regex format?), which are ignored in topic matching. This would cater for multiple different implementations. |
Hello, |
I like my idea above of specifying the prefixes to ignore in a method. Should be pretty easy to implement. I'll do that soon if no-one else does. |
Is this issue still present with the MQTT 5 client? It seems I'm facing the exact same issue. |
After looking at the code, I'd say the following few lines should use the topic with the |
Is there any news about when it will be released? |
Submitted this fix awhile ago, but would love to see some feedback on it - #911 |
Callbacks don't get called when subscribing to shared subscriptions, e.g.
$share/group/topic
, using thesubscribe(String topicFilter, int qos, IMqttMessageListener messageListener)
API.However, shared subscriptions work as expected when using the
setCallback(...)
API before invokingsubscribe(String topicFilter, int qos)
.I have written a simple Java application which reproduces the issue.
https://github.com/codeasone/shared-subscriptions-issue
This issue impacts wrappers such as the Clojure library machine-head, which is what led me here...
HEAD
ofdevelop
branch throws exceptions with my test program suggesting a regression wrt.1.1.x
API, which may or may not be related.The text was updated successfully, but these errors were encountered: