Search code examples
javajmsactivemq-classicactivemq-artemisamazon-mq

How can I move to the Jakarta namespace while using Amazon MQ?


I'm trying to migrate a codebase from Java 11 to 17, but I'm stuck with the ActiveMQ client artifact which is bound to the javax package which is removed from the JDK in later versions.

The system connects to a Amazon MQ broker (running ActiveMQ 5) using the OpenWire protocol. Thinking I hit the jackpot, I tried replacing the ActiveMQ client with the Apache Artemis client which also supports JMS but it doesn't seem to be able to connect the Amazon MQ broker.

I'm getting the following error message:

org.apache.activemq.artemis.api.core.ActiveMQConnectionTimedOutException: AMQ219013: Timed out waiting to receive cluster topology. Group:null

Ideally, the ActiveMQ project would publish a jakarta-bound alternate client. Am I doing something obviously stupid here?


Solution

  • ActiveMQ Classic doesn't ship a Jakarta Messaging 3 compatible client (i.e. the first version of Jakarta Messaging to use the jakarta namespace). There is some discussion on AMQ-7309 regarding this, but it is still in the "open" state which means there is no Jakarta Messaging 3 compatible client for ActiveMQ Classic at this point. There may be one in the future, but it would come with the 5.18.0 release at the earliest and that release currently isn't scheduled.

    ActiveMQ Artemis does ship a Jakarta Messaging 3 compatible client, but it can't be used to connect to ActiveMQ Classic because it doesn't speak the OpenWire protocol.

    You're not doing something obviously stupid. What you want to do just isn't currently supported directly by ActiveMQ Classic.

    However, you could use Qpid JMS 2.0.0 which supports Jakarta Messaging 3 via the AMQP 1.0 protocol. I'm not sure all the features will work since ActiveMQ Classic doesn't fully support JMS 2, but it's your best option.