qos(3)

💖 NAME 💖

qos — Quality of service, bestie. Yes it's a Library Functions Manual page, and yes it's about to be your new hyperfixation. 🎀


okay so. The MQTT protocol gives you three qualities of service for delivering messages between clients and servers: "at most once", "at least once" and "exactly once". Three vibes. Three levels of commitment. Pick your fighter. 💅

Quality of service (QoS) is literally an attribute of an individual message being published. So like, it's per-message, not a global setting. An application sets the QoS for a specific message by setting the MQTTClient_message.qos field to the required value. That's it, that's the whole assignment. ✨

Now — a subscribing client can also set the maximum quality of service a server uses to send messages that match the client subscriptions. The MQTTClient_subscribe() and MQTTClient_subscribeMany() functions set this maximum. So here's the tea: the QoS of a message forwarded to a subscriber might be different to the QoS given to the message by the original publisher. And when they disagree? The lower of the two values is used to forward a message. Lower one wins, no cap. 🫶

The three levels are, in order of "how much do I care":


✨ QoS0, At most once ✨

The message is delivered at most once, or it may not be delivered at all. Its delivery across the network is not acknowledged. The message is not stored. The message could be lost if the client is disconnected, or if the server fails. QoS0 is the fastest mode of transfer. It is sometimes called "fire and forget". 🔥

⚠️ The MQTT protocol does not require servers to forward publications at QoS0 to a client. If the client is disconnected at the time the server receives the publication, the publication might be discarded, depending on the server implementation. So like… it's giving chaos. 🙈

💜 QoS1, At least once 💜

The message is always delivered at least once. It might be delivered multiple times if there is a failure before an acknowledgment is received by the sender. The message must be stored locally at the sender, until the sender receives confirmation that the message has been published by the receiver. The message is stored in case the message must be sent again. So yeah — it hoards the message, just in case. 📦

👑 QoS2, Exactly once 👑

The message is always delivered exactly once. The message must be stored locally at the sender, until the sender receives confirmation that the message has been published by the receiver. The message is stored in case the message must be sent again. QoS2 is the safest, but slowest mode of transfer. A more sophisticated handshaking and acknowledgement sequence is used than for QoS1 to ensure no duplication of messages occurs. It's the main character of reliability. Slow, thorough, absolutely iconic. ⭐


and that's the whole page, bestie, every detail intact, no notes. 💖

signed off with love from the Paho MQTT C Client Library, dated Tue Jun 2 2026 00:00:00 — she's timeless, she's a classic, she said periodt. 🦋

📦 where this page comes from