Skip to content

What is QoS?

Camilo Sperberg edited this page Jul 17, 2018 · 5 revisions

QoS or Quality of Service in terms of a MQTT broker means that at certain levels, a message will be delivered no matter how to the client. This is done by looking at the provided ClientId sent by the client itself.

In general terms, a PUBLISH packet being sent from the broker with QoS level

  • 0: is not guaranteed to be delivered to a subscribed client. Data loss may occur due to network issues or other circumstances. If the client connects later with the same ClientId, none or some of the previous messages may arrive.
  • 1: is guaranteed to be delivered to a subscribed client. However, if no reception confirmation is sent from the client or received by the broker, the broker may try to send the message again, therefore duplicates may occur.
  • 2: is the most advanced option, a message is guaranteed to reach a subscribed client once and only once.

This library will perform all of this handling automatically for you by using the Subscribe->loop() function.

UML Diagram

An image says more than a thousand words, therefor this diagram which should explain pretty much how QoS messaging works:

UML Activity Diagram of a MQTT Message

Clone this wiki locally