vertx-mqtt
vertx-mqtt copied to clipboard
Develop the persistence and recovery for "in flight" messages queues
The client should be able to persist the "in flight" messages queues (QoS 1 and 2) in order to recover them after coming back online (due to a previous disconnection).
I can work on that. But before we should discuss it.
Let's start with a simple case:
- The client was connected with a server and he just has some messages in queues.
- And then a client was instantly disconnected from the server
And now there is some question to discuss: What should be done next?
I would propose that a user should:
- catch closing a connection through a closeHandler
- call setCleanSession(true)
- call connect
And after that, the client should one-by-one resend all packets in all queues
What do you think about it? Is that what is expected from the feature?
Great ! :-)
You can check here (http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.pdf) how the client session works and it's based on the "clean session" flag sent within the CONNECT packet.
@ppatierno, what do you think about the #57 PR?