Presentation from the Virtual IoT User Group.
MQTT has been established amongst the most popular IoT protocols for Device-To-Cloud-Communication.
The new MQTT 5 standard, which has been released in early 2018, comes with a number of new features and improvements, making the lightweight protocol more versatile than ever. The technical committee at OASIS worked hard to develop new functionality and improvements for the protocol that were in high demand, without changing MQTT in its fundamental core.
How can those features be applied in real projects? And how backward compatible is the new version? Is it time to upgrade yet? We’ll discuss all these questions and Open Source implementations in this session.
The video of the presentation is available on Youtube: https://youtu.be/czne5-8El-k
5. MQTT
Use Cases
Push Communication
Reliable Communication
over unreliable networks
Constrained Devices
Low Bandwidth and
High Latency
Enterprise backends
to mobile
communication
13. MQTT 5 - Overview
Non-backward compatible
Officially released December 2017/January 2018
Many new features
Clarifications of the 3.1.1 specification
Successor of MQTT 3.1.1
14. Improved error reporting
Formalize common patterns including
capability discovery and request response
Extensibility mechanisms including user
properties
Performance improvements and support
for small clients
Enhancements for scalability and large
scale systems
MQTT 5 - Goals
16. Return Codes for Unsupported Features
ACKs can contain Negative acknowledgements
Properties in MQTT Header & Reason Codes
•Retain Available
•Maximum QoS
•Wildcard Available
•Subscription Identifiers available
•Shared Subscriptions available
•Maximum Message Size
•Server Keep Alive
17. Streamlined Session State / Lifecycle
Source: https://www.eclipse.org/community/eclipse_newsletter/2016/september/article3.php
18. Passwords without usernames allowed
Bi-directional DISCONNECT packets
New Data Type: UTF-8 String pairs
New Protocol version on the wire
No QoS 1 & 2 retry
Other notable changes
21. Session Expiry Interval in Seconds
Broker expires session after the given interval as soon as
the client disconnects
Publication Expiry interval is an optional part of a
PUBLISH message
Applies to online and queued messages
Session Expiry is an optional part of the CONNECT
message
Session & Message Expiry
23. Reason Strings are optionally available
Return codes optionally,server can choose for security
reasons to just disconnect clients
Return Codes from protocol level errors to application
level errors
DISCONNECT messages allow clients to figure out why
they were disconnected
CONNACK,PUBACK,PUBREC,PUBREL,PUBCOMP,
UNSUBACK,DISCONNECT,SUBACK and AUTH
packets can carry error codes
Return Codes - Negative Acknowledgements
25. Return codes for ACK messages available if
payload format is invalid
Receiver may validate the format indicator
“Content Type” optional header can carry a MIME type
“Payload Format Indicator” can be binary or UTF-8
Optional part of a PUBLISH message
Payload Format Indicator & Content Type
27. Publishing Client must subscribe to a response
topic prior to sending data
“Request Response Information” Header for response
topic
“Correlation Data” header for correlation of request/
response
Request / Response is a pattern that is also available
for MQTT 3.1.1
Request / Response
29. Special Syntax: $share/{ID}/my/topic
Useful for scaling out backend subscribers
Already supported by HiveMQ for MQTT 3.1 and MQTT
3.1.1
Client Load Balancing
Shared Subscriptions
32. Can be part of most MQTT packets
UTF-8 encoded Strings
An unlimited number of user properties can be added
User Defined Metadata Headers
User Properties
38. No Announcement for MQTT 5 compatibility yet
No MQTT 5 Support yet
Mosquitto
No recent public MQTT 5 development activities
39. Early Access Version in Q2/2018 => http://bit.ly/hmq-ea
No MQTT 5 Support yet
HiveMQ
100% MQTT 5 support in Q3/2018
Completely backwards compatible
Will support all optional MQTT 5 features at massive scale
40. No IoT SaaS Service offers MQTT 5 yet
No MQTT 5 compatible broker available yet
Other Brokers
Many optional MQTT 5 features - Be sure to check if broker
of choice supports all required features!
Preliminary Test Broker at Eclipse Paho project available
44. MQTT 5 support planned for June 2018
MQTT 5 support in separate branch
Eclipse Paho C
Developers seek active feedback
45. Reactive Design with built-in backpressure handling
New Java MQTT 5 (and 3.1.1) Open Source Client library
MQTT Bee
Built for high scalability and supports
tens of thousands messages per second
Available on Github in March / April 2018
Created and maintained by the HiveMQ and BMW CarIT folks
46. Wait!
There’s more
MQTT 5 Blog Post Series:
http://www.mqtt5.com
“Technical Foundations
of the IoT” Book