1
Python paho-mqtt

can someone help me how to read all the client id that is connected to the broker? ex: i subscribed to some topic and i want to get all the client id who connected to the same topic

SCouto
  • 7,808
  • 5
  • 32
  • 49
  • Similar question on: https://stackoverflow.com/questions/9767040/get-a-list-of-connected-client-ids-from-mqtt-client you might want to check on it – EvheMary Jun 15 '20 at 11:44
  • That question doesn't mention anything about determining if a connected client is subscribed to a topic. – hardillb Jun 17 '20 at 07:35

1 Answers1

0

The short answer is: You don't

The Publish/Subscribe model is specifically set up to decouple the publishing clients from the subscribing clients and subscribers from each other.

While on some broker implementations it may be possible to get the list of currently connected clients by monitoring entries in the $SYS/# topic tree you can not get the list of topics those clients are subscribed to.

hardillb
  • 54,545
  • 11
  • 67
  • 105