Skip to content

Commit

Permalink
Add non conflict unique messageId support.
Browse files Browse the repository at this point in the history
In order to avoid messageId allocating and registering conflict,
during store processing, publish, subscribe, and unsubscribe
functions are enqueued.
The enqueued functions are invoked when the store processing will
be finished. During the invocation, messageId is allocated. messageIds
could be run out. In this case, stop invocation.
The rest of functions in the queue are remained.
When puback, pubcomp, suback, or unsuback is received, the messageId is
deallocated and become reusable, so the queue invocation process is
continued.
  • Loading branch information
redboltz committed Jun 16, 2021
1 parent be17dd7 commit 0eb3396
Show file tree
Hide file tree
Showing 16 changed files with 642 additions and 164 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ the `connect` event. Typically a `net.Socket`.
urls which upon reconnect can have become expired.
* `resubscribe` : if connection is broken and reconnects,
subscribed topics are automatically subscribed again (default `true`)
* `messageIdProvider`: custom messageId provider. when `new UniqueMessageIdProvider()` is set, then non conflict messageId is provided.

In case mqtts (mqtt over tls) is required, the `options` object is
passed through to
Expand Down
Loading

0 comments on commit 0eb3396

Please sign in to comment.