paho.mqtt.android
paho.mqtt.android copied to clipboard
Access to sessionPresent after automatic reconnect
Thanks for this fork and the maintenance.
I am testing a persistent connection between app and broker: I am using the sessionPresent flag after a successul connection to decide if a new subscription is necessary: If server acknowlegdes the connection and set the sessionPresent=true, the app wont need new subscriptions.
But I can't access the sessionPresent flag after a automatic reconnect, because the onSuccess
-callback of my IMqttActionListener
is not called. Only the IMqttActionListener onSuccess
-callback contains the token for that flag
Am I wrong with my concept of connection and subscription - or might it be useful to implement some sort of access to that sessionPresent flag during the reconnection?
Hmm, is there a call onSuccess()
missing ?
Anyway, if you found a solution, I'm happy to approve the solution !
The onSuccess
Method of org.eclipse.paho.client.mqttv3
is called in case of a successful reconnect but there is only a
MqttReconnectActionListener
as a callback called but not the onSuccess
of my IMqttActionListener
My workaround at the moment is to disable automatic Reconnect. And to reestablish the connection after 3secs
Note: The first connection made through MqttAndroidClient.connect(...)
where I can set the callback to my callback, works perfectly. OnSuccess
is called and I can access the sessionPresent
comming from the broker server
This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you!
This issue has been automatically marked as stale because it has not had recent activity. Please comment here if it is still valid so that we can reprioritize. Thank you!