Hi,
this is the first self created topic in this forum, be kind please :
Short:
- Assuming a MQTT Broker capable of shared subscriptions
- MQTT.js "supports" shared supscriptions (at least not prevents them)
- The core node "MQTT-In" has a method
matchTopic
that prevents shared subscriptions from working. - I already fixed it locally, happy to contribute via PR
Extended:
Shared Subscriptions for MQTT as already implemented by some brokers and defined in MQTT v5:
- subscribe to:
$share/SHARENEMAE/topic
- publish to:
topic
- the broker will forward the message to only ONE subsriber (client id) of the topic.
To my understanding the matchTopic(ts,t)
function in nodes/core/io/10-mqtt.js
checks if the topic string subscribed to matches the topic string in the received message (including MQTT wildcards etc.).
With shared subscriptions ts will not match t ($share/SHARENEMAE/topic
vs. topic
).
I am not saying this will implement v5 just "not prevent" shared subscriptions.
I will create a PR today.
Any comments?
Best regards
Lars