Hi,
I am writing an android app using Java which connects to AWS IoT mqtt using the aws-android-sdk-iot.
After making an initial connection to the broker, I do the following steps -
- Subscribe to topic A.
- Unsubscribe from topic A.
- Subscribe to topic B.
- Unsubscribe from topic B.
Now, to simulate an abnormal disconnect, I turn the phone off.
Since I am listening to the LifeCycle events, I see that the connection is disconnected after the keepalive limit expires.
On turning the phone on, reconnect is tried. Successful reconnection happens but I also see a successful subscription to the topic A.
I have unsubscribed from topic A already, so why do I see a re-subscription to that on reconnect?
I have tried setting needResubscribe() to false using setAutoResubscribe(false) on the ASWIotMqttManager but it did not make a difference.
Please let me if this is expected behavior or something going wrong here.
Thanks!