Agent Properties — Last Will
The "Last Will and Testament" (LWT) is a convention for MQTT to notify subscribed clients when a client has disconnected unexpectedly without a "DISCONNECT" notice. To enable and configure an MQTT Last Will and Testament, double-click on the agent name or right-click on the agent and select Properties. Then select the Last Will group.
Enable Last Will and Testament: Select Yes or No to enable a "last will" message. The default setting is No.
Topic: identifies the topic or path to serve as the last will and testament message.
Message: contains the text that subscribed clients will receive in the last will and testament message. This is typically an explanation of the ungraceful disconnect, such as "offline" or "unexpected exit" to help the client.
In addition to the Last Will message, the MQTT agent publishes a message to the Last Will topic if the first data publish succeeds and when the MQTT agent is shut down due to a project edit, server reinitialize, or server shutdown.
On first successful publish, the following text is published to the Last Will topic if the feature is enabled:
"Server is online."
On graceful shutdown, the following text is published to the Last Will topic if the feature is enabled:
"Server is shutting down."
Was this helpful?