Vardit
Vardit

Reputation: 1086

MQTT: Subscribe to topics that no client subscribed to

I would like to have a "default" client that gets all MQTT messages on topics that no one subscribed to. Is that possible?

I read about $SYS topics but they don't seem to provide a solution.

Upvotes: 0

Views: 265

Answers (1)

hardillb
hardillb

Reputation: 59826

No, it is not possible to know what topics every other client is subscribed to easily/in a browser independent way. You may be able to build a list of what topics clients are subscribed to from the info in the $SYS/# topic tree on some broker implementations, but that won't help you find the inverse, which is what you are asking for.

The only option would be to subscribe with the wildcard topic of #. This would get all (assuming no ACLs in place) messages published to all topics.

If you could build the list I mentioned in the fist paragraph then you could use this as a filter.

Upvotes: 1

Related Questions