Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The MQTT Sparkplug B specification defines a way for subscribing clients (like MQTT Engine) to notify publishing clients (like MQTT Transmission Module) when they are online or offline. The publishing clients can then key off of a particular subscriber’s status to do different things when the subscriber’s status changes either online or offline.  One One example would be that the disconnection of a main application such as a SCADA system could trigger the devices to stop transmitting any data as the main application is not available to receive the published data.

 When When the MQTT server determines a an ungraceful disconnect between itself and the main application, it will published publish a retained message to all connected clients stating that the main application is offline. When the Edge Node is notified that the Main application has gone offline, the Edge Node will close its connection with the server and it will lock walk to the next one on the list. If there's no next on the listthe Edge Node is unable to make a connection to any server, it may have the ability to store that data locally in a buffer. That way, when it reconnects, the stored data can be delivered to its final destination.

...

If that primary host ID is not set, the Edge Node will not subscribe on these notification topics and will not receive any of these state notifications. In this case, data will only be buffered where when it loses connection to the MQTT server not if the main application loses connection to the MQTT server. 

...

When configured, MQTT Engine will publish it's its connection state on a topic that contains the Primary Host ID.

...

In the event that MQTT Engine becomes disconnected from the MQTT Distributor or Chariot server, a death certificate will be published on the same topic setting the state to 'offline'.  Any connecting client that subscribes on the state topic will then be notified of the MQTT Engine state.

...

When configured, MQTT Transmission will subscribe on 'state' notification topics which are published by the broker. If MQTT Transmission is notified that MQTT Engine has gone 'offline', it will close it's its client connection with the MQTT server and begin to store messages locally (assuming Store and Forward is enabled) to be sent once MQTT Engine is back online.

When MQTT Transmission is notified that MQTT Engine has is back 'online', it will publish all BIRTH messages along with the stored data.

...

Note

If the Primary Host ID is not set:

  • MQTT Transmission will not subscribe on the notification topics and not receive any 'state' notifications to trigger the data storage
  • MQTT Engine tags that were set to Stale on a disconnect from the MQTT server will remain staled after a re-connect until either:
    • Data changes at the Edge which will result in a REBIRTH request from MQTT Engine
    • An MQTT Transmission refresh is performed forcing BIRTH messages to be published

...