MQTT Essentials
Overview
MQTT (opens new window) is a standard messaging protocol for the Internet of Things (IoT). It is designed as an extremely lightweight publish/subscribe messaging transport that is ideal for connecting remote devices with a small code footprint and minimal network bandwidth.
MQTT today is used in a wide variety of industries, such as IoT, mobile web, intelligent hardware, Internet of Cars, smart city, telemedicine, electricity, oil and gas, etc.
- MQTT 3.1.1: http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html (opens new window)
- MQTT 5.0: http://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html (opens new window)
Advantages
- Open messaging protocol, easy to implement
- Publish/subscribe model, support one-to-many message publishing
- Based on TCP/IP network connection
- Compact message structure with 1 byte of fixed header and 2 bytes of heartbeat message
- Message QoS supported, reliable message transmission
- Flexible messaging capability, with no dependency on payload data format
- Persistent session awareness, with timely information on whether the device is online
Core Feature
Below is a list of MQTT protocols and the EMQX extended concepts:
- Publish/Subscribe Model
- Session and Message Expiration
- QoS
- Retained Messages
- Will Message
- Shared Subscription
- Exclusive Subscription
- Delayed Publish
- Auto Subscribe
- Topic Rewrite
- System Topic
Comparison With Other Protocols
Typical IoT use cases are very complex, with many devices, networks, applications, and services involved, therefore a variety of IoT protocols have emerged. You may refer to the link below for a comparison between MQTT and other protocols:
MQTT, CoAP, or LwM2M? Which IoT protocol to choose? (opens new window)