Skip to content

Instantly share code, notes, and snippets.

@haio
Last active December 30, 2015 21:19
Show Gist options
  • Save haio/7887024 to your computer and use it in GitHub Desktop.
Save haio/7887024 to your computer and use it in GitHub Desktop.
MQTT QoS Levels
MQTT defines three levels of Quality of Service (QoS). The QoS defines how hard the broker/client will try to ensure that a message is received. Messages may be sent at any QoS level, and clients may attempt to subscribe to topics at any QoS level. This means that the client chooses the maximum QoS it will receive. For example, if a message is published at QoS 2 and a client is subscribed with QoS 0, the message will be delivered to that client with QoS 0. If a second client is also subscribed to the same topic, but with QoS 2, then it will receive the same message but with QoS 2. For a second example, if a client is subscribed with QoS 2 and a message is published on QoS 0, the client will receive it on QoS 0.
Higher levels of QoS are more reliable, but involve higher latency and have higher bandwidth requirements.
* 0: The broker/client will deliver the message once, with no confirmation.
* 1: The broker/client will deliver the message at least once, with confirmation required.
* 2: The broker/client will deliver the message exactly once by using a four step handshake.
http://www.eclipse.org/paho/files/mqttdoc/Cclient/qos.html
http://www.ekito.fr/people/?p=2969
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment