Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get MQTT subscriptions

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.

like image 719
Farzad Aghaeizadeh Avatar asked Dec 13 '18 17:12

Farzad Aghaeizadeh


1 Answers

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.

like image 87
hardillb Avatar answered Sep 29 '22 06:09

hardillb