1

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?

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
matsa
  • 346
  • 5
  • 16
  • Right now, I'm trying to get feedback from the ActiveMQ project itself: https://issues.apache.org/jira/browse/AMQ-7309 – matsa Jun 08 '22 at 06:20
  • I updated my answer to add details regarding AMQ-7309. For what it's worth, I'm an ActiveMQ developer although I'm mainly focused on ActiveMQ Artemis. – Justin Bertram Jun 08 '22 at 13:57
  • Any more feedback here? I realize you're discussing the issue on AMQ-7309, but that's really independent of your question here on Stack Overflow. As far as I can tell my answer addresses the question(s) you asked here. – Justin Bertram Jun 14 '22 at 15:57
  • You're, of course, correct. :) Luckily, in the other thread, I was made aware that I was wrong about ActiveMQ holding me back from Java 17, so the migration to Java 17 is complete while EE9+ has to wait. – matsa Jun 15 '22 at 06:35

1 Answers1

3

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.

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
  • 1
    Jakarta JMS compatible version ActiveMQ 5.18.0 released [ANN] Apache ActiveMQ 5.18.0 has been released. – neorus Mar 30 '23 at 06:22
  • ActiveMQ 5.18 _has_ been released, but it only provides a pseudo Jakarta Messaging 3.1 implementation. It still doesn't support async send with a `CompletionListener`, sending messages with a delivery delay, and using shared topic consumers which are arguably the most important new features originally introduced in JMS 2. However, if you're using JMS 1.1 API calls with the `jakarta` namespace then it should work fine. – Justin Bertram Mar 31 '23 at 20:14
  • @JustinBertram i'm trying to use activemq-client-jakarta and all work almost fine, i can't create JmsTemplate with a pooledconnectionfactory because activemq-jms-pool doesn't have migrate to jakarta namespace. Does exist a solution for this? thanks – Mançaux Pierre-Alexandre May 03 '23 at 12:46
  • 1
    @MançauxPierre-Alexandre I'd recommend you use [pooled-jms](https://github.com/messaginghub/pooled-jms). It was forked from ActiveMQ's pool and support for Jakarta Messaging was added in 3.0. The latest release is [3.1](https://central.sonatype.com/artifact/org.messaginghub/pooled-jms/3.1.0). – Justin Bertram May 03 '23 at 14:01
  • @JustinBertram thanks for your reactivity, i have integrate pooled-jms and all work as expected ;) – Mançaux Pierre-Alexandre May 03 '23 at 15:34
  • Fantastic! My client application is now able to move into the Jakarta namepace and "beyond". – matsa May 16 '23 at 10:30
  • Unfortunately, my unit tests that were using the 'activemq-broker' artifact still depend on javax.jms. I attempted to replace this with artemis-junit-5 using the OpenWire protocol but there seems be no Jakarta compatible 'artemis-jakarta-junit-5' artifact. Until that becomes available, it seems I will still be stuck at EE8. – matsa May 19 '23 at 08:58
  • @JustinBertram another question about this problem, i m using tcp and https connection in my application so i need to use activemq-http but no project activemq-http-jakarta exist, did you know if its planned? i see that activemq-client-jakarta is just succession of maven plugin to create jakarta one, perhaps same things can be done for http jar? thanks – Mançaux Pierre-Alexandre May 30 '23 at 15:54
  • @MançauxPierre-Alexandre, you should ask a new question about this. – Justin Bertram May 30 '23 at 16:21
  • @JustinBertram ok, done. – Mançaux Pierre-Alexandre May 30 '23 at 16:35