You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
More of a question than anything else. Running into an issue where long running subscriptions seem to be being dropped or forgotten inconsistently by the broker I'm using VernMQ. I need some way to find out if the subscription I have as the devices need to act on the incoming messages.
Basic flow of the device's state is CONNECT -> SUBSCRIBE -> IDLE(wait for data) -> SEND -> IDLE(ect.). The subscribe is always directly after the connect and as long as no disconnects or errors are seen it stays in idle and waits for data to send.
I have an idea to send to the topic that is supposed to be described, but if there's a direct way in paho to check if a subscription is still valid that would be more ideal. Is there some functionality in paho I'm missing to help with this?
The text was updated successfully, but these errors were encountered:
There isn't a formal broker agnostic way to find that out in MQTT as far as I know.
Each client could send a test message to the topic once it has subscribed to see if the message gets back, but anyone else subscribed to that topic would have to know to expect test messages too.
Some brokers have an admin API that allows you to query the state of the broker. Often HTTP and you'd have to have admin access.
I just had a look at MQTT 5. and there is a reason code on unsubscribe ("no subscription existed") so that would be a way, if VerneMQ used that reason code. You'd be unsubscribing in the process though.
Again in MQTT 5 there is a subscribe option to only send retained messages if the subscription did not previously exist. So if you set a retained message on the topic (which some other client could remove when you weren't looking!) and use this option, if the client received a retained message you'd know that the subscription didn't previously exist.
More of a question than anything else. Running into an issue where long running subscriptions seem to be being dropped or forgotten inconsistently by the broker I'm using VernMQ. I need some way to find out if the subscription I have as the devices need to act on the incoming messages.
Basic flow of the device's state is CONNECT -> SUBSCRIBE -> IDLE(wait for data) -> SEND -> IDLE(ect.). The subscribe is always directly after the connect and as long as no disconnects or errors are seen it stays in idle and waits for data to send.
I have an idea to send to the topic that is supposed to be described, but if there's a direct way in paho to check if a subscription is still valid that would be more ideal. Is there some functionality in paho I'm missing to help with this?
The text was updated successfully, but these errors were encountered: