SmartSwarm 300 Series
:
52
QOS
The Quality of Service level is an agreement between sender and receiver of a message
regarding the guarantees of delivering a message. There are 3 QoS levels in MQTT:
●
At most once (0)
●
At least once (1)
●
Exactly once (2)
With QoS for MQTT, there are always two different parts of delivering a message:
publishing client to broker, and broker to subscribing client.
The QoS level for publishing client to broker depends on the QoS level the publishing client
sets for the particular message.
When the broker transfers a message to a subscribing client it uses the QoS of the
subscription made by the subscribing client.
That means that QoS guarantees can get downgraded for a particular receiving client if
subscribed with a lower QoS.
In the case of SmartSwarm 351, we only need to consider the QoS for the publishing client
to broker.
Retain
This flag determines whether the message will be saved by the broker for the specified
topic as the last known good value.
New clients that subscribe to that topic will receive the last retained message on that topic
instantly after subscribing.
Table 15. MQTT Interface
These settings are the general MQTT connection settings.
For each individual Rule and Topic that has an MQTT Publish associated with it, it is possible to specify
the QoS, Retain, Topic and Payload for that individual Publish. This is configured within the “Rules and
Topics” section..
Last Will and Testament messages are sent by the broker, to subscribing clients, when any of the
following cases occur.
An I/O error or network failure is detected by the broker;
The client fails to communicate within the Keep Alive time;
The client closes the network connection without sending a DISCONNECT packet first;
The server closes the network connection because of a protocol error