MQTT Doesn't Have Message Queues. Inside the 2-Byte Protocol Powering Modern IoT.
A visual, 10-minute architectural deep dive into MQTT. Learn how the 2-byte binary wire protocol, QoS 0/1/2 handshakes, topic trees, Last Will and Testament, and MQTT v5 Shared Subscriptions actually deliver IoT telemetry under the hood.
First seen by Oriel on .
AI summary
This article explains MQTT’s binary protocol, broker routing, delivery guarantees, and state features while arguing that MQTT topics are not message queues by default.
- MQTT publishes messages to topics through a broker; when no subscribers are online, messages are discarded unless a persistent session buffers unacknowledged QoS 1 or QoS 2 messages.
- Its fixed header can be two bytes, using packed control flags and variable-byte length encoding that supports payloads up to 268,435,455 bytes.
- QoS 0 minimizes overhead but can lose messages, QoS 1 may deliver duplicates, and QoS 2 prevents duplicates through a four-packet handshake.
- Brokers route hierarchical topics through in-memory Trie structures, while + matches one level and # matches all remaining levels.
- Retained messages provide new subscribers with the latest state, while KeepAlive and Last Will and Testament detect unexpected device disconnections.
#mqtt #iot #publish-subscribe #message brokers
Generated by gpt-5.6-sol. Check the original for details.
Metric trends
Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained
Reactions
Total public reactions reported by the source; distinct from points and likes.
- DEV Community: 29, latest observation ; +5 over observed period since
Comments
Comment count reported by the source.
- DEV Community: 17, latest observation ; +14 over observed period since
Aliases
| Source | External ID | URL |
|---|---|---|
| DEV Community | 4826046 | https://dev.to/smtahosin/mqtt-doesnt-have-message-queues-inside-the-2-byte-protocol-powering-modern-iot-161 Read discussion |