I am trying to migrate to Spring Boot 3 with the new namespace jakarta instead of javax, but the ActiveMQ Classic client has not been updated and was deprecated. Is there a way to continue using the old ActiveMQ client?
I tried the new ActiveMQ Artemis client but it seems like they are not interoperable with the ActiveMQ Classic server.
Including the old ActiveMQ client results in not being able to use JMSTemplate for configuration because JMSTemplate uses jakarta.xx and expects a ConnectionFactory from jakarta.xx not javax.xx
Edit: Didn't work so the only way is to upgrade to ActiveMQ Artemis. That way the codebase is also nearly unchanged.
Edit: April 2023: The new ActiveMQ Client was released. You only need to swap the spring-boot-starter-activemq with the updated version and include this
Jakarta JMS compatible version ActiveMQ 5.18.x has been released. I was able to get this version working with no Spring 5.3.x dependencies:
Removed
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-activemq</artifactId>
</dependency>
and included the broker with the new "jakarta client" dependency:
<!-- 5.18 brings initial JMS 2.0 (javax.jms API) and Jakarta Messaging 3.1 (jakarta.jms API) client support -->
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-broker</artifactId>
<version>5.18.1</version>
<exclusions>
<exclusion>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-client</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-client-jakarta</artifactId>
<version>5.18.1</version>
</dependency>
We are now again able to send and receive messages with the (not yet migrated) unchanged ActiveMQ installation on our servers - parallel with a Spring Boot 2.7.x application and a 3.0.5 Spring application.
To continue to use ActiveMQ 5.x with Spring 3 and Jakarta EE 9, two updates are needed on the ActiveMQ 5.x side-- JMS 2.0 support, and then support for javax.jms -> jakarta.jms namespace change.
The first part is the biggest, and is underway. The ActiveMQ 5.x main branch has preview support for JMS 2.0, and there are plans to provide Jakarta namespace support shortly after.
This is a good page to track JMS 2.0 progress in ActiveMQ 5.x
ref: https://activemq.apache.org/jms2
UPDATE: Apache ActiveMQ 5.18.1 includes a jakarta-enabled client 'activemq-client-jakarta'
Edit: Spring Boot v3 support being added with this change: https://github.com/spring-projects/spring-boot/pull/35048
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With