1
votes

The Mosquitto MQTT broker offers a feature to bridge two MQTT brokers for publishing and subscribing of messages. This is described here.

When any client publishes messages to ActiveMQ Artemis broker I want these messages to be automatically published to another MQTT broker based on a configured topic mapping. I want to know if this is possible via a feature built-in to ActiveMQ Artemis or possibly via a broker plugin.

1

1 Answers

2
votes

Artemis does have bridging functionality for the "core" protocol as well as a generic JMS bridge implementation, but it has no MQTT bridging functionality built-in. Also, I don't think it would be a good idea to implement this via a broker plugin for two reasons. First, a plugin really should be as low-latency as possible as any latency from a plugin will impact any other client. Second, the structure of the plugin architecture would not lend itself to this task; in fact, I'm not sure it would be possible at all.

That said, I see two possible solutions:

  1. Create a Camel route to do the bridging work and deploy it as a WAR to the embedded Jetty instance shipped with Artemis. The Camel route will run within the same JVM as the Artemis broker so no additional processes/management will be necessary. Camel is easy to use and extremely powerful. There is an example of how do this that ships with Artemis.
  2. Deploy a Mosquitto broker in bridge mode to move the messages between brokers.