Connection
#
Birth and Last Will:When an agent is connected for the first time it responds with two acknowledgement messages one acknowledging the connection establishment (BirthJSON/CONNECTED ack) and the next acknowledging the subscription (SUBSCRIBED ack) to the topic,only if the agent supports two way communication.
On the abrupt disconnection of the agent from the facilio mqtt broker, the broker DISCONNECTED ack/LastWillMessage.
The last will message will be set during the connection establishment itself.
Status codes
Connection | Status Codes |
---|---|
CONNECTION_LOST | 0 |
CONNECTED | 1 |
SUBSCRIBED | 2 |
DISCONNECTED | 3 |
CONNECTION_ACTIVE | 4 |
Sample Birth Message
{ "agent": "agent-name", "status": 1, "publishType": 2}
Sample Subscribtion Success Message
{ "agent": "agent-name", "status": 2, "publishType": 2}
Sample Last Will Message
{ "agent": "agent-name", "status": 0, "publishType": 2}