← Back to the chapter · Previous detail · Next detail →

Technical detail · MQTT QoS Levels

Testing MQTT QoS recovery on each delivery leg

Message Queuing Telemetry Transport (MQTT) quality of service (QoS) describes protocol delivery separately from publisher to broker and from broker to subscriber.

A publisher sends messages, a broker routes them, and a subscriber receives messages selected by a subscription. QoS 0 sends without acknowledgement; QoS 1 permits duplicates while awaiting acknowledgement; QoS 2 uses a packet-identifier handshake to suppress duplicate protocol delivery. The DUP flag marks a repeated publish packet, and application deduplication records identify repeated work. A persistent session preserves client-related state across connections.

Retained messages are saved for subscribers; handshake state tracks an active exchange. Offline delivery also depends on session settings, queue policy and broker limits.

MQTT QoS is negotiated and enforced on each delivery leg. A publisher can send to the broker at one QoS, while a subscriber receives at a different effective QoS depending on its subscription and broker behavior. The broker is not just forwarding bytes; it may store state, retry, downgrade delivery, or queue messages for a persistent session.

This is why QoS should not be described as end-to-end business confirmation. A broker acknowledgement is not the same as application handling. Critical workflows still need an application-level acknowledgement, audit record, or state readback.

One practical test is to drop the network after each acknowledgement boundary and inspect what happens on reconnect. For QoS 1, the duplicate path should be visible through the DUP flag and through application deduplication logs. For QoS 2, the broker and client should resume the packet-id handshake instead of executing the action twice. Those traces make the distinction between protocol delivery and physical outcome concrete.

← Back to the chapter · Previous detail · Next detail →