DEV Community 👩‍💻👨‍💻

Cover image for MQTT: Quality of Service (QoS) Levels | Part 6
HiveMQ
HiveMQ

Posted on • Originally published at hivemq.com

MQTT: Quality of Service (QoS) Levels | Part 6

In this post, we explain the different Quality of Service levels in MQTT.

What is Quality of Service (QoS)?

The Quality of Service (QoS) level is an agreement between the sender of a message and the receiver of a message that defines the guarantee of delivery for a specific message. There are 3 QoS levels in MQTT:

At most once (0)
At least once (1)
Exactly once (2).
When you talk about QoS in MQTT, you need to consider the two sides of message delivery:

Message delivery form the publishing client to the broker.
Message delivery from the broker to the subscribing client.

Why is Quality of Service (QoS) important?

QoS is a key feature of the MQTT protocol. QoS gives the client the power to choose a level of service that matches its network reliability and application logic. Because MQTT manages the re-transmission of messages and guarantees delivery (even when the underlying transport is not reliable), QoS makes communication in unreliable networks a lot easier.

There are 3 levels of QoS in MQTT

  • QoS 0 - at most once
  • QoS 1 - at least once
  • QoS 2 - exactly once

To under these QoS levels in detail, read this article or watch the below video.

Get your copy of MQTT Essentials eBook to understand the protocol in detail without you having to read the entire specification.

Top comments (0)

🌚 Life is too short to browse without dark mode