HiveMQ Edge: Adapter chaining

Hello everybody,

I am about to develope a custom Adapter for the edge, that will handle incomming messages and map those to a specified internal protocol (that means the MQTT payload has a specific format).

Now I was wondering if it is possible to chain adaperts after each other? For example the integrated MQTT Connector receives a message and instead of forwarding this to the internal MQTT-Broker, the message is forwarded to my custom protocol adapter.

Maybe this example is not the best practice, but it clearely shows my intention.

Best regards,
Till

Hello @adtlmoe

This is actually not supported and probably not trivial to implement. However, we have payload modifications/transformations on the roadmap for HiveMQ Edge.

Do you want to modify JSON payload into some other formats?

Kind regards,
Diego from HiveMQ Team

Hello @Diego,

Exactly! Here is an example:

The Payload I get is:

{
   "code": "Test",
   "cid": 42,
   "adr": "myTopic",
   "data": {
        "event": 123,
        "srcurl": "/counter/datachange",
        "payload": {
              "/timer[1]/counter": {
                  "code": 200,
                  "data": 1 },
              "/iolinkmaster/port[1]/iolinkdevice/pdin": {
                  "code": 200,
                  "data": "00010010" }
          }
}

My goal is to reduce this Payload to:

{
   "temperature": "00010010"
}

So I want to extract: data β†’ paypload β†’ /iolinkmaster/port[1]/iolinkdevice/pdin β†’ data
And rename this to a different name.

Maybe you have an idea how to achieve this or if this will be supported by your extension.

Kind regards,
Till

Hello @adtlmoe

We are supporting JSON payload transformation with JavaScript in the latest HiveMQ Data Hub.

https://docs.hivemq.com/hivemq/latest/data-hub/transformations.html

It’s on our roadmap to add this feature to HiveMQ Edge in Q1/2024. Please note that this date is an estimate.

Kind regards,
Diego from HiveMQ Team