TsgcWSPClient_MQTTProperties › ConnectProperties

ConnectProperties Property

MQTT 5.0 properties sent with the CONNECT packet: session expiry, receive maximum, packet size, topic aliases and extended authentication.

Syntax

property ConnectProperties: TsgcWSMQTTConnect_Properties read FConnectProperties write SetConnectProperties;

Default Value

Enabled=False, SessionExpiryInterval=0, ReceiveMaximum=65535, MaximumPacketSize=MaxInt, TopicAliasMaximum=0, RequestResponseInformation=False, RequestProblemInformation=True

Remarks

(MQTT 5.0 only.) Sub-properties are ignored when MQTTVersion = mqtt311. Set Enabled to True to serialize the block into the CONNECT variable header. Fields include SessionExpiryInterval (seconds; 0 ends the session when the network connection closes), ReceiveMaximum (maximum concurrent QoS 1 / QoS 2 publications the client will process), MaximumPacketSize (largest packet the client will accept), TopicAliasMaximum (maximum incoming Topic Alias value), RequestResponseInformation (ask the broker to return Response Information in CONNACK), RequestProblemInformation (allow the broker to include Reason String and User Properties), UserProperties (custom name=value diagnostic data) and AuthenticationMethod (the extended authentication method name used with the Auth method).

Example


MQTT.MQTTVersion := mqtt5;
MQTT.ConnectProperties.Enabled := True;
MQTT.ConnectProperties.SessionExpiryInterval := 3600;
MQTT.ConnectProperties.ReceiveMaximum := 20;
MQTT.ConnectProperties.TopicAliasMaximum := 10;
MQTT.ConnectProperties.UserProperties.Add('app=sensor-01');

Back to Properties