Good day everyone. I am very new to OR and still learning how all the internal features fit together. I am trying to figure out which would be the best way to integrate the MQTT Sparkplug specification.
A little about the specification, Sparkplug solves 3 problems with MQTT:
- Structured topic names space. The specification defines a standardized topic structure that ALL clients must conform to.
- Structured Payload. The specification defines the structure of the payload in JSON but is serialized with protobuf
- State awayness. The specification defines different messages such as BIRTH, DEATH, DATA, and COMMAND messages which are defined in the topic and each would need to be handled differently by the OR server.
The Birth message provides all the information required for the OR server to create data points. names, engineering units, data type etc.
Data messages, provide the device data
Command messages are used to send commands to the devices.
I am trying to determine which would be the best approach to implement this in OR, using a custom agent or a custom MQTT handler.
The end goal would be that in the manager interface, you could register a topic eg:
namespace/group_id/message_type/edge_node_id/
when a Birth message is received on that topic an asset is created with attributes from the birth message and the “state” attribute is set to healthy/online. Attributes are linked to the correct data message
when a Data message is received attribute update takes place.
when a death message is received the “state” attribute is set to unhealthy/offline
What are your thoughts on this, would you need to combine a custom handler and a custom agent to handle the different messages, or do it all in an agent or all in the custom handler?
Here are some links to the specification https://sparkplug.eclipse.org/