TsgcWSPClient_MQTTProperties › QoS

QoS Property

Default Quality of Service level and retry/timeout behavior for outbound QoS 1 and QoS 2 messages.

Syntax

property QoS: TsgcWSMQTTQoS_Options read FQoS write SetQoS;

Default Value

Level=mtqsAtMostOnce, Interval=60, Timeout=300

Remarks

Level is the default QoS applied by convenience methods when no explicit value is supplied: mtqsAtMostOnce (QoS 0 — fire-and-forget), mtqsAtLeastOnce (QoS 1 — acknowledged with PUBACK, may duplicate) or mtqsExactlyOnce (QoS 2 — four-way handshake PUBLISH/PUBREC/PUBREL/PUBCOMP, guaranteed single delivery). Interval (seconds) is how often the internal QoS store resends unacknowledged QoS 1 and QoS 2 messages; Timeout (seconds) is the maximum age after which an unacknowledged message is dropped from the store. QoS 0 messages bypass the retry store entirely. Increasing Timeout helps on high-latency or intermittent links; set both to 0 to disable the resend logic and rely solely on MQTT 5.0 session expiry.

Example


MQTT.QoS.Level := mtqsAtLeastOnce;
MQTT.QoS.Interval := 30;
MQTT.QoS.Timeout := 600;
MQTT.Publish('sensors/temp', '21.5');

Back to Properties