Skip to content

MQTT Persistent Session Subscription Loss After Network Disconnect/Reconnect #740

Discussion options

You must be logged in to vote

A few additional clarifications:

The SDK never resubscribes under any circumstances. If your session is still active on the broker then previously-established subscriptions will still be active. Whether or not a session was rejoined is communicated in the corresponding event:

311 client: https://github.com/awslabs/aws-crt-cpp/blob/v0.27.4/include/aws/crt/mqtt/MqttConnection.h#L60-L64
5 client: https://github.com/awslabs/aws-crt-cpp/blob/v0.27.4/include/aws/crt/mqtt/Mqtt5Client.h#L225-L231(you can check the connack packet's sessionPresent field, or you can check the negotiated settings rejoinedSession field)

If your session is not active then all subscriptions are gone and you must re-esta…

Replies: 3 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@shani-g-electreon
Comment options

Comment options

You must be logged in to vote
3 replies
@shani-g-electreon
Comment options

@bretambrose
Comment options

@shani-g-electreon
Comment options

Answer selected by jmklix
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants