Skip to main content

ActiveMQ Jakarta Messaging 3.1 & JMS 2.0 Support

Transition Approach

Initially, ActiveMQ clients will not support all JMS 2.0 functionality and will throw an UnsupportedOperationException (RuntimeException) for unsupported methods and features, such as those for async send with a CompletionListener, sending messages with a delivery delay, and using shared topic consumers.

As features are implemented in subsequent releases, these exceptions will be replaced with fully functional methods, examples and unit tests. See later/below for more details on implementation progress.

Jakarta Messaging

Support for JMS 2.0 also enables building upon this for transition to Jakarta Messaging 3.1 and its new jakarta.jms API namespace rather than the historical javax.jms namespace.

  • The standard for Java Enterprise features going forward
  • Required for Spring 6
  • Required for Jakarta EE 9 + 10.
  • JMS API Java package name-change only
  • ActiveMQ package names do not change

This allows for a dependency-update-only approach to the transition without having to re-code going forward!

Client jarAPI PackageVersionNotes
activemq-clientjakarta.jms6.0.xPartial Jakarta Messaging 3.1 support. Works with embedded broker and VM transport.
activemq-clientjavax.jms5.18.xPartial JMS 2.0 support. Works with embedded broker and VM transport.
activemq-client-jakartajakarta.jms5.18.1+Transitional module for partial, client-only Jakarta Messaging 3.1 support. Can't be used in the same JVM as activemq-client or broker which use javax.jms API. Note this means no embedded broker / VM transport support, only remote brokers.

There is no functional change, this is purely a Java package naming change:

import javax.jms.ConnectionFactory
import javax.jms.Message
import javax.jms...

Becomes:

import jakarta.jms.ConnectionFactory
import jakarta.jms.Message
import jakarta.jms...

To use the Jakarta transition client available with ActiveMQ 5.18.x in Maven:

<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-client-jakarta</artifactId>
<version>${activemq.version}</version>
</dependency>

Note: With ActiveMQ 6.x the activemq-client-jakarta module is removed as it is no longer needed.

Spring bean usage

Spring bean definitions do not change for Jakarta support.

<bean class="org.apache.activemq.ActiveMQConnectionFactory">

Implementation Progress

The implementation approach is subject to change. Be sure to verify features in release notes.

User feedback is welcome! Please comment on the JIRAs with questions and comments.

JIRAStatusTarget VersionCompleted VersionFeatureNotes
AMQ-73095.16.05.18.0JMS 2.0 API dependencyActiveMQ will ship with a JMS 2.0 dependency jar
AMQ-83225.17.05.18.0JMSContext, JMSConsumer, JMSProducer, & JMSRuntimeExceptionSimplified JMS API support
AMQ-83215.18.05.18.0GetBody/isBodyAssignableSupport for checking body type using a Class<?>
AMQ-83255.18.3, 6.0.05.18.3, 6.0.0XA Connection methodsUpdated methods when using XA transactions
AMQ-84945.17.15.18.0Implement CLIENT_ACKNOWLEDGEMENT modeClient ack requires special handling w/ the simplified JMSContext API
AMQ-84646.4.0JMSConsumer.receiveBody(Class<T>) methods
AMQ-83206.3.0Delivery DelaySupport for Message DeliveryDelay feature
AMQ-83246.4.0JMSProducer featuresCompletionListener async send support
AMQ-8323Shared Topic ConsumerMulti-consumer (queue-like) consuming from topic subscriptions
AMQ-94516.5.0Pooled ConnectionFactorySupport for JMSContext in activemq-jms-pool

Feature notes

JMS ObjectFeatureNotes
JMSProducerdisableMessageIDActiveMQ does not support the optional and rarely used JMS Specification feature to disable JMS message ID