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.
REQUIREMENTS:
$sparkplug/certificates/namespace/group_id/NBIRTH/edge_node_id
$sparkplug/certificates/namespace/group_id/NBIRTH/edge_node_id
with the MQTT retain flag set to true$sparkplug/certificates/namespace/group_id/DBIRTH/edge_node_id/device_id
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:
sparkplug.version=spBv1.0
sparkplug.systopic=$sparkplug/certificates/
sparkplug.compression=false
sparkplug.json.log=false
sparkplug.systopic.msgExpiry=4294967296
When using logger sparkplug.json.log, add the configuration settings appender
and 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 hivemq/log/sparkplug-json-payload.log
.
Installing the extension for HiveMQ is very easy:
hivemqExtensionZip
to build the extension.build/hivemq-extension/hivemq-sparkplug-compatible-extension-4.X.X.zip
to the directory: HIVEMQ_HOME/extensions
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.