diff --git a/.gitbook/assets/subscribe_payload.png b/.gitbook/assets/subscribe_payload.png new file mode 100644 index 0000000..f973724 Binary files /dev/null and b/.gitbook/assets/subscribe_payload.png differ diff --git a/SUMMARY.md b/SUMMARY.md index f8c820b..d5b15d1 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -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 @@ -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) diff --git a/misc/qos-1-options.md b/misc/qos-1-options.md new file mode 100644 index 0000000..1c17294 --- /dev/null +++ b/misc/qos-1-options.md @@ -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)