vertx-mqtt icon indicating copy to clipboard operation
vertx-mqtt copied to clipboard

Develop the persistence and recovery for "in flight" messages queues

Open ppatierno opened this issue 7 years ago • 3 comments

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).

ppatierno avatar Aug 31 '17 12:08 ppatierno

I can work on that. But before we should discuss it.

Let's start with a simple case:

  1. The client was connected with a server and he just has some messages in queues.
  2. 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:

  1. catch closing a connection through a closeHandler
  2. call setCleanSession(true)
  3. 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?

Sammers21 avatar Sep 02 '17 15:09 Sammers21

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 avatar Sep 03 '17 15:09 ppatierno

@ppatierno, what do you think about the #57 PR?

Sammers21 avatar Dec 09 '17 16:12 Sammers21