Hi folks,
I’m currently working hard on implementing a SparkplugB PayloadFormatter that
would allow us to directly consume a SparkplugB mqtt stream.
However have I noticed two things:
1. The current PayloadFormatter interface, doesn’t pass the topic to the
format method (in Sparkplug the device Id is located in that)
2. The current config option enable_mqtt_service does two things
* It starts a local MQTT broker
* It registers as client to the MQTT broker configured in the settings
I worked around the Problem in 1) by Adding a PayloadFormatterV2 interface
which extends the PayloadFormatter, that adds one method:
List<Message> format(String topic, ByteBuf payload);
Then I extended the MPPPublishHandler to check if the handler instance
implements V2 or not.
If it’s a V2 it calls the new method and passes the topic along, if not, it
uses the old one. This way no compatability problems should occur.
However I would never use a broker like the moquette broker in a large scale
production environment. Here I’d probably go for HiveMQ or alike.
Unfortunetely we currently can’t enable the MQTT consumer stuff without
starting the broker.
I think we need 2 settings here.
Chris