Skip to content

Commit 541111e

Browse files
committed
Added QoS explanation in the README.
Fixes mqttjs#431.
1 parent 4d08393 commit 541111e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ in JavaScript for node.js and the browser.
1919
* [Command Line Tools](#cli)
2020
* [API](#api)
2121
* [Browser](#browser)
22+
* [About QoS](#qos)
2223
* [Contributing](#contributing)
2324
* [License](#license)
2425

@@ -450,6 +451,17 @@ you can then use mqtt.js in the browser with the same api than node's one.
450451

451452
Your broker should accept websocket connection (see [MQTT over Websockets](https://github.com/mcollina/mosca/wiki/MQTT-over-Websockets) to setup [Mosca](http://mcollina.github.io/mosca/)).
452453

454+
<a name="qos"></a>
455+
## About QoS
456+
457+
Here is how QoS works:
458+
459+
* QoS 0 : received **at most once** : The packet is sent, and that's it. There is no validation about whether it has been received.
460+
* QoS 1 : received **at least once** : The packet is sent and stored as long as the client has not received a confirmation from the server. MQTT ensures that it *will* be received, but there can be duplicates.
461+
* QoS 2 : received **exactly once** : Same as QoS 1 but there is no duplicates.
462+
463+
About data consumption, obviously, QoS 2 > QoS 1 > QoS 0, if that's a concern to you.
464+
453465
<a name="contributing"></a>
454466
## Contributing
455467

0 commit comments

Comments
 (0)