1回答
- 新しい順
- 投票が多い順
- コメントが多い順
0
When connecting the client, set the cleanSession
flag to false
to resume an existing session if one exists.
Set the sessionExpiryInterval
to a non-zero value to persist the session for a duration even after disconnection.
On reconnecting, subscriptions, pending messages and QoS 1 messages will be reinstated from the previous session.
You can test this by publishing messages while the client is disconnected. On reconnecting, these messages should be received by the client.
Make sure the client ID remains the same across connections for the broker to identify and resume the correct session.