This extension adds to HiveMQ with the functionality of a Sparkplug Aware Broker, which fulfills the optional requirements of the new Sparkplug specification.
License: Apache 2.0
This HiveMQ Sparkplug Aware Extension extends HiveMQ with the functionality of a Sparkplug Aware Broker, which fulfills the optional requirements of the new Sparkplug specification, released with the new Sparkplug Release - Sparkplug v.3.0.0. Apart from providing the necessary native HiveMQ MQTT features like Retained Message handling and all QoS levels, the Sparkplug Aware Broker fulfills the following requirements.
A Sparkplug Aware MQTT Server MUST store NBIRTH and DBIRTH messages as they pass through the MQTT Server
A Sparkplug Aware MQTT Server MUST make NBIRTH messages available on a topic of the form:
A Sparkplug Aware MQTT Server MUST make NBIRTH messages available on the topic:
$sparkplug/certificates/namespace/group_id/NBIRTH/edge_node_id with the MQTT retain flag set to true
A Sparkplug Aware MQTT Server MUST make DBIRTH messages available on a topic of the form:
A Sparkplug Aware MQTT Server MUST make DBIRTH messages available on this topic with the MQTT retain flag set to true
A Sparkplug Aware MQTT Server MAY replace the timestamp of NDEATH messages. If it does, it MUST set the timestamp to the UTC time at which it attempts to deliver the NDEATH to subscribed client.
The Extension expects the configuration file
sparkplug.properties to be in the extension home folder. This configuration file contains a set of properties to align the behavior of the extension. The topic structure root for the systopic, and the sparkplug version can be configured. Compression is switched off by default. An optional log output of the payload in formatted JSON can be configured. The JSON is available from a separate logger. The Message Expiry of the retained messages sent to the systopic can be configured to a smaller lifetime. If not set, the standard expiration for a message is used (max_uint seconds).
Default properties are:
When using logger sparkplug.json.log, add the configuration settings
logger from the
src/hivemq-extension/logback-example.xml file to your
hivemq/conf/logback.xml configuration. With this, the sparkplug payload will be written as JSON into the separate file
Installing the extension for HiveMQ is very easy:
Clone this repository into a Java 11 Gradle project.
Execute the Gradle task
hivemqExtensionZip to build the extension.
Move the file:
build/hivemq-extension/hivemq-sparkplug-compatible-extension-4.X.X.zip to the directory:
Unzip the file.
If you want to contribute to HiveMQ Sparkplug Aware Extension, see the Contribution Guidelines.
HiveMQ Sparkplug Extension is licensed under the APACHE LICENSE, VERSION 2.0. A copy of the license can be found here.
We're always happy to answer any questions you may have during installation. The best place to get in contact is ourcommunity forum.