Request all published topics

gillesC picture gillesC · Mar 2, 2017 · Viewed 19.7k times · Source

I'm using Mosquitto for my MQTT Broker.

I was wondering if it would be possible to request all published topics?

Thus NOT by subscribing to everything, i.e. #.

EDIT: I don't want to subscribe to every available topic. I'm just looking for a way to retrieve all published topics. The broker could for instance response with a string array containing all the published topics.

Answer

Gambit Support picture Gambit Support · Mar 2, 2017

Manageability of MQTT brokers is very immature at this point. I also don't know of a way to retrieve the list of published topics from any broker. But, there are standardization efforts, eg. with the $SYS topic tree https://github.com/mqtt/mqtt.github.io/wiki/SYS-Topics.

Other brokers are manageable via SNMP, eg. MessageSight https://www.ibm.com/support/knowledgecenter/en/SSCGGQ_1.2.0/com.ibm.ism.doc/Monitoring/admin00008_.html . It can list the topics in its WEB interface, but I don't know of a programmatic way to retrieve them.