MQTT 5 New features

MQTT 5.0 has made major changes based on MQTT 3.1.1 and is not backward compatible.

MQTT 5.0 supports many new features. EMQ X Broker supports MQTT 5.0 protocol from version 3.0. It is the first broker in the open source community to support the protocol specification and is fully compatible with MQTT V3.1 and V3.1.1 protocols.

Highlights of MQTT 5
check User attributes

Support user-defined attributes and transmission of additional custom information to expand more application scenarios.

check Topic alias

Reduce the overhead of MQTT messages by shortening the topic name to a small integer.

check Session expiration

Split the cleanup session flag into a new start flag and the session expiration interval can be modified when disconnected.

check Flow control

Allow the client and server to specify the number of outstanding reliable messages (QoS> 0) respectively.

check Message expiration

Allows messages to be published with an expiration interval.

check Maximum packet length

Allow the client and server to individually specify the maximum message lengths they support.

check Reason codes of all confirmation packets

All response packets contain reason codes so that the caller can determine whether the requested function was successful.

check Optional server function availability

Inform the client the feature list supported by the server to avoid the client using unsupported features.

check All confirmation message reason strings

Designed for problem location.

check Enhanced authentication

Provide a mechanism to enable challenge/response style authentication including mutual authentication.

check Server disconnection

The server is allowed to send a DISCONNECT message to indicate why the connection was closed.

check Subscription options

Provide subscription options that are primarily used to define applications allowing message bridging.

check Payload format and content type

Allows to specify payload format (binary, text) and MIME-style content types when publishing messages.

check Will delay

Provide the ability to delay the sending of the specified will message after the connection is interrupted.

check Request / response mode

Specify the MQTT request / response mode, provide the response topic and compare data attributes, and control the response message to be routed back to the request publisher.

check Server keeps connected

Allow the server to specify the keep-alive values it wants the client to use.

check Shared subscription

Implemented in v3.1.1, adding support for shared subscriptions to allow load balancing for multiple subscription consumers.

check Assign client identifier

If the server has assigned a client identifier, this client identifier is returned to the client.

check Subscription identifier

Allows to specify a digital subscription identifier in the subscription packet and returns this identifier when the message is distributed.

check Server reference

Allows the server to specify a standby server.

MQTT 5 related tutorials
What is the MQTT protocol

With the advent of the 5G era, the great vision of the IoT is becoming a reality. The number of connected IoT devices has reached 7 billion in 2018.

Advanced features of MQTT topics

MQTT protocol transmits application messages over the network. When application messages are transmitted over MQTT, they have an associated quality of service (QoS) and topic (Topic).

Use of MQTT Will Message

When the client disconnects, a will message is sent to the relevant subscriber.

Introduction to MQTT 5.0 protocol-shared subscription

Shared subscription is a new feature introduced by MQTT 5.0 protocol, which is equivalent to the load balancing function of subscribers.

Introduction to MQTT QoS

MQTT protocol specifies the quality of service, which guarantees the reliability of message delivery under different network environments.

MQTT 5.0 new feature - Clean Start and Session Expiry Interval

Clean Start and Session Expiry Interval in MQTT V5.0 are not unfamiliar to those who have experience in using MQTT v3.1.1 protocol.

MQTT 5.0 Features | Retain Message

Although the publish-subscribe model fully decouples the publisher of the message from the subscriber, there is also an implicit problem that the subscriber cannot actively request the message from the publisher, and when the subscriber receives the message depends entirely on the publisher.

MQTT 5.0 new features | (1) properties and loads

Compared with MQTT 3.1.1, MQTT 5.0 protocol adds many properties, which are distributed in variable headers and payloads of packet.

MQTT 5.0 new features |(2) Reason code and ACK

MQTT v3.1.1 protocol has only 10 return codes. These return codes can represent little meaning, and the same return code value can have different meanings in different messages.

MQTT 5.0 new features (3) - Payload Format Indicator and Content Type

Payload Format Indicators and Content Type are two new properties introduced in MQTT 5.0.

MQTT and Kafka

MQTT is completely different from Kafka. MQTT is a protocol and a technical standard developed by members (mostly are top engineers at IBM and Microsoft) of the OASIS Technical Committee.