Can ActiveMQ Artemis be used as a “protocol adaptor”?

We have an IoT infrastructure with devices communicating over MQTT. However, now we also have the requirement that these devices must post sensor data to a queue for cloud processing that evaluates and stores it.

As MQTT does not support a pulling model, I am currently looking at possible queueing services to use. ActiveMQ Artemis has caught my eye because of the various protocols it supports, among other things MQTT, and a REST-interface.

What I cannot clearly see in the documentation, though, is if Artemis can merely serve as a single broker for multiple message queues, or if it can actually be used to convert between them.
The plan so far was to have an MQTT-client subscribed to the “processing” topic that would collect all the messages published to it and shove them into a polling queue, where workers would come to collect them. It seems that there is a possibility that Artemis could do that without additional services running, but I’m not at all sure whether I’m interpreting the documentation right.

So to ask a straightforward question: Can I rig Artemis so I can publish MQTT messages to it and then poll them from a queue, using for example the REST-interface?

Answer

In general message brokers are used for application integration. As such, you can usually send messages with one protocol and consume them with another. This is the case for ActiveMQ Artemis. You can certainly publish a message using MQTT and then consume it using the REST interface.

That said, I would recommend using the STOMP protocol rather than the REST interface. The STOMP protocol is standardized whereas the REST interface is unique to ActiveMQ Artemis. STOMP is very simple and can be used in most (if not all) of the places where a REST messaging client would be used. Lots of brokers implement STOMP so if you ever needed to migrate to a different broker the job would substantially easier.

Attribution
Source : Link , Question Author : UncleBob , Answer Author : jbertram

Leave a Comment