MQTT provides three Quality of Service (QoS) levels for individual message delivery—I am emphasizing individual message delivery because QoS levels apply to the delivery of individual messages and not to a topic. This will become clearer as you work through the examples.
While you, as the developer, stipulate the QoS for your messages, it's the broker that is responsible for ensuring that the message delivery adheres to the QoS. Here is the QoS you can apply to a message and what they mean for delivery:
QoS level |
Meaning |
Number of messages delivered |
Level 0 |
The message will be delivered at most once, but maybe not at all. |
0 or 1 |
Level 1 |
The message will be delivered at least once, but perhaps more. |
1 or more |
Level 2 |
The message will be delivered exactly once. |
1 |
You might be asking the question: Level...