MQTT Reception - “Parameters” -> “General”
General: Configuration of the Broker connection data and definition of a Last Will and Testament message type:
Connection Parameters: In this section are the parameter to configure the Broker connection:
First at all, a unique client ID for each client connected to the same Broker must be defined. It is recommended to use a clear ID to get an easier interpretation of the Broker log. The following two parameters are the host and access port of the Broker.
Optionally, a user and password identification can be configured, as part of the Broker configuration. It is recommended to configure several users to access to the Broker in a safe way.
Finally, it is possible to configure a connection to the server through a proxy defining a host and port.
Additional Parameters: In this section there are some additional parameters to configure the Broker connection:
If the connection of the Broker or server that host it is lost, it will begin a reconnection period. It is very important to be able to recover the connection without losing the data persistence, so no message published since the last connection is lost; consequently, this process is executed regularly until it get a reconnection or the channel is manually stopped by the administrator.
The first parameter define the timeout between each reconnection attempt.
The second parameter, belonging to the MQTT protocol, define the time interval between each verification of the connection status sent out by the Broker: each X secs, defined by the Keep Alive ratio, Broker and client ping each other. If the Broker do not get an answer during the specified time, the adapter considers the connection between Broker and Adapter is lost, changing the status to reconnection.
The third parameter represent a clean session, without data persistence. The data persistence of a connection allows the connection status to be kept, regardless of the Broker connection; meaning the information of the subscribed Topics, number of received messages, client ID, etc… are stored between connections.
- Last Will and Testament Parameters: In this section, the LWT parameters can be defined:
The Last Will and Testament process consist of sending a message to the Broker when the Adapter detects a sudden connection loss. This message must have been previously stored in its memory, indicating the specific Topic where the message will be sent and a preset Quality of Service. It is an optional process; in fact, it recommended for use only in very specific cases such as channels that may present errors and handle sensitive data.
Parameters to be configure are: the Topic of the Last Will and Testament, the Quality of Service of the message to be sent and the Message to be sent when the connection is unexpectedly lost.
Avvale 2024