-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
MQTT.js and shared subscriptions #789
Comments
Would you like to contribute? See #651 . |
Not sure I have the required skills, but I'll try to find time to look into it. Thanks. |
Is there any progress on the implementation of this feature? |
It has been implemented in Node-Red - source - which uses MQTT.js. The issue is that MQTT.js default client treats However, in Node-Red - and I'm not sure I'm correct on the sequence of things here - it seems that the handler for the subscription overrides the default and validates each message against the actual topic without So if you were to do something similar in your client, you might get it to work... |
Hey 👋 Can someone confirm this is fixed ? |
This is an automated message to let you know that this issue has If this issue is still important, you can simply comment with a Thank you for your contribution. |
This issue was automatically closed due to inactivity. |
Unable to use shared subscription in the latest version of MQTT.js. Client keeps subscribing in loop and doesn't consume any message. Will this be supported or is there a work-around ? |
I am also seeing this behavior. Did you find a solution? |
Could someone share a minumum reproduction script? |
Several MQTT brokers are now supporting shared subscriptions (HiveMQ, VerneMQ, EMQ) from the v5 MQTT standard.
The syntax of subscribing to a shared topic seem currently differs based on broker:
HiveMQ
$share:sharename:topic/subtopic/etc
(details)VerneMQ
$share/sharename/topic/subtopic/etc
(details)EMQ
$queue/topic/subtopic/etc
or
$share/sharename/topic/subtopic/etc
(details)
The MQTT v5 standard specifies
$share/sharename/topic/subtopic/etc
(details)So, at least VerneMQ and EMQ both works with the standard.
Any messages published to topic
topic/subtopic/etc
should then be distributed by the broker to the different subscribers using the$share/sharename/topic/subtopic/etc
subscription, but only 1 of the subscribers will get the message. (Which subscriber depends on broker and settings.)Using this feature makes load balancing very easy.
However, it seems MQTT.js does not yet support this as messages published to a topic with shared subscriptions from MQTT.js are ignored.
Are there any plans to implement this?
The text was updated successfully, but these errors were encountered: