How to get MQTT subscriptions

Farzad Aghaeizadeh :

As a MQTT client I want to know how can I get subscriptions(TOPICS):

I use Paho library and java as a client, with connecting with setCleanSession(false) so the client subscriptions(TOPIC) keeps in MQTT broker after disconnecting, if the topic subscription didn't emits some data , I didn't know that subscription is alive.

so I want to get all topic subscriptions of my MQTT client and if some topic didn't emits data for 10 minutes , unsubscribe that topic.

hardillb :

You can not.

There is no way to query the broker for what topics the client has subscribed to in the protocol and in fact most MQTT client libraries don't even keep a list of subscribed topics for the current session.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=70496&siteId=1