The MQTT component provides a lightweight, fully-featured MQTT client implementation with support for versions 3.
The MQTT component provides a lightweight, fully-featured MQTT client implementation with support for versions 3.1.1 and 5.0. The component supports plaintext and secure connections over both standard TCP and WebSockets.
Connection to an MQTT server is simple, you need to drop this component in the form and select a TsgcWebSocketClient Component using Client Property. Set host and port in TsgcWebSocketClient and set Active := True to connect.
MQTT v5.0 is not backward compatible (like v3.1.1). Obviously too many new things are introduced so existing implementations have to be revisited.
According to the specification, MQTT v5.0 adds a significant number of new features to MQTT while keeping much of the core in place.
The Clean Session flag functionality is divided into 2 properties to allow for finer control over session state data: the CleanStart parameter and the new SessionExpInterval.
Server disconnect: Allow DISCONNECT to be sent by the Server to indicate the reason the connection is closed.
All response packets (CONNACK, PUBACK, PUBREC, PUBREL, PUBCOMP, SUBACK, UNSUBACK, DISCONNECT) now contain a reason code and reason string describing why operations succeeded or failed.
Enhanced authentication: Provide a mechanism to enable challenge/response style authentication including mutual authentication. This allows SASL style authentication to be used if supported by both Client and Server, and includes the ability for a Client to re-authenticate within a connection.
The Request / Response pattern is formalized by the addition of the ResponseTopic.
Shared Subscriptions: Add shared subscription support allowing for load balanced consumers of a subscription.
Topic Aliases can be sent by both client and server to refer to topic filters by shorter numerical identifiers in order to save bandwidth.
Servers can communicate what features they support in ConnectionProperties.
Server reference: Allow the Server to specify an alternate Server to use on CONNACK or DISCONNECT. This can be used as a redirect or to do provisioning.
More: message expiration, Receive Maximums and Maximum Packet Sizes, and a Will Delay interval are all supported.