Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .gitbook/assets/subscribe_payload.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
* [Advanced Options](configuration/advanced_options.md)
* [Storage](configuration/storage.md)
* [No Op Engine](configuration/noopengine.md)
* [Redis based subscription store](configuration/routing.md)
* [Generic offline store](configuration/genericofflinestore.md)
* [Redis based message passing](configuration/messagepassing.md)
* [Redis based subscription store](configuration/routing.md)
* [MQTT Bridge](configuration/bridge.md)

## VerneMQ Clustering
Expand Down Expand Up @@ -72,9 +72,11 @@

## Misc

* [QoS 1 options](misc/qos-1-options.md)
* [Loadtesting VerneMQ](misc/loadtesting.md)
* [Not a tuning guide](misc/not-a-tuning-guide.md)
* [Change Open File Limits](misc/change-open-file-limits.md)

## Guides

* [A typical VerneMQ deployment](guides/typical-vernemq-deployment.md)
Expand Down
23 changes: 23 additions & 0 deletions misc/qos-1-options.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Custom options over QoS 1 in MQTT v3.1.1

We have added to options to the subscribe packet:
- Non-Retry
- Non-Persistence

These options can be used in QoS 1 topics to modify the behaviour of QoS 1 messages published to these clients.

## Non-Retry
This option disables the functionality in the broker to retry QoS 1 messages. A perfect use-case of such behaviour is when you want to track reliability of message delivery (tracked using PubAcks) but do not want to retry the message to avoid staleness or duplication among other reasons.

## Non-Persistence
This option disables persistence of messages. This is useful again to avoid stale messages to clients.
Both the options combined can give you QoS 0 behaviour with PubAck which we find suitable for some of our use-cases.

## Subscribe packet
The payload of a SUBSCRIBE Packet contains a list of Topic Filters indicating the Topics to which the Client wants to subscribe.
Each filter is followed by a byte called the Requested QoS. This gives the maximum QoS level at which the Server can send Application Messages to the Client. We have modified this byte to add information about non-retry and non-persistence.


The requested maximum QoS field is encoded in the byte following each UTF-8 encoded topic name, and these Topic Filter / QoS and non-retry and non-persistence bits are packed contiguously.

![](../.gitbook/assets/subscribe_payload.png)