1
votes

I am exploring ActiveMQ for advanced messaging between heterogeneous applications based on different technologies - C, Java, Ruby and Python. While looking at supported protocols I am stumbled to understand the use case of mixing protocols while performing message exchange. I had searched ActiveMQ documentation but unable to find any such reference talking about this.

My question is, say -

Producer (NewsPublisher) is publishing news(Sports, Finance, World) to a topic (NewsTopic) using AMQP. After publishing, this topic is storing these news under respective queues (Sports, Finance and World Queues) In this situation, a client subscribed to Sports queue is JMS based, another client subscribed to Finance queue is Stomp based; can these clients will be able to receive message available on the queue which was published using AMQP by NewPublisher?

I see a somewhat related question posted earlier however found answers unrelated to original question so thought to double check.

1

1 Answers

2
votes

Mixing protocols in ActiveMQ is not all that hard, the broker takes care of all the internal routing and converting of messages from the incoming protocol to the outgoing bit so you don't have to worry to much about that.

What you do have to focus on is the common denominator of message types that your client mix allows you to use. In you question you've listed three different protocols AMQP, OpenWire, and STOMP (I'm guessing the JMS you are referring to is the ActiveMQ JMS client which uses OpenWire).

In this mix STOMP is the one to start with as it offers the least amount of options for message payload (Text and Binary) so you need to start there. Can you messages be restrained to those two domains? To send to STOMP from a JMS client then you can restrict yourself to a JMS TextMessage and or a JMS BytesMessage. In AMQP you will also need to restrict the message payload then to either a Text based payload for binary (think Data section containing a Binary wrapping an array of bytes).

ActiveMQ's STOMP protocol handler does offer some options to do Message transformations from other type such as converting a MapMessage into a JSON based string payload but it best to start simple and work your way up.

Given the breadth of the subject matter there a lot more that could be said, but this should help get you started. In short, yes you can mix clients on different protocols just fine in ActiveMQ but you do need to have some understanding of the limitations in doing so.