activemq-classicactivemq-artemis

ActiveMQ different encoding per connection


I'm new to ActiveMQ. I'm trying to run an embedded broker with multiple connectors. I envision each connector having its own encoding (ie a connector that handles POJOs (ObjectMessage), a different connector that handles json, another with yaml, another with xml, etc). I further envision being able to send a message to a topic, and then have that message distributed to various clients, each encoded by how they've connected.

Is this possible?

Is this vision the correct way of setting things up?

I've tried using a MessageTransformer, but that seems to be applied at the Session level.

As a slightly unrelated question: should I be using classic ActiveMQ, or Artemis?


Solution

  • Neither ActiveMQ Artemis nor ActiveMQ Classic operate the way you describe.

    They both support certain messaging protocols (e.g. AMQP, STOMP, MQTT). Clients use those protocols to send messages in essentially any format they want.

    Consumers can also use those protocols to consume messages. Messages sent via one protocol can be consumed via a different protocol. In this way the broker acts as an integration platform so that multiple different processes potentially written in multiple different languages and on multiple different platforms can interoperate.

    It is possible to change the format of a message when it arrives on the broker (e.g. via a transformer), but typically the authors of the producers and consumers agree on an data format and use that to facilitate interoperability.