Open inad9300 opened 6 months ago
Liberty JMS makes use of Java Connector Architecture (or Jakarta Connectors for the newer standards). ActiveMQ Artemis provides two different resource adapters depending on whether you are using Java EE 8 or Jakarta EE 9 (I assume the Jakarta EE 9 will work on 10, but I'm not an ActiveMQ Artemis expert). These are available in maven central using the following coordinates:
For JMS 2
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-jakarta-ra</artifactId>
<version>2.33.0</version>
</dependency>
For Jakarta Messaging 3
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>artemis-ra</artifactId>
<version>2.33.0</version>
</dependency>
once you have downloaded the resource adapter you would configure Liberty to know about the location of the resource adapter:
<resourceAdapter id="artemisMQ" location="/path/to/downloaded/artemis.rar" />
Then to configure a JMS Connection Factory you would use configuration like this:
<jmsConnectionFactory jndiName="jms/artemisCF" >
<properties.artemisMQ connectionParameters="" />
</jmsConnectionFactory>
The properties element under the jmsConnectionFactory
must end with the id from the resourceAdapter
element. The configuration for the properties element is defined by the Artemis RA and I found some documentation at apache for what those are.
Liberty has other elements for configuring jmsQueue
, jmsTopic
and jmsActivationSpec
that follow a similar pattern.
I suspect you got the versions wrong and "artemis-ra" corresponds to JMS 2 while "artemis-jakarta-ra" corresponds to Jakarta Messaging 3, right?
That aside, I'm a bit lost as to how to go from the "artemis-jakarta-ra" Maven dependency to a RAR file accessible by Open Liberty. Is there anything you can share about this?
Finally, to use it, is this how I would do it?
@Resource(name = "jms/artemisCF")
private ConnectionFactory connectionFactory;
Is enabling <feature>jndi-1.0</feature>
via server.xml
necessary?
I'm looking into using ActiveMQ Artemis in my Open Liberty project in an idiomatic way. I was not able to find any good materials that explained how to specify a Jakarta Messaging provider for Open Liberty to use.
Is there any documentation and/or examples on how to use a third-party JMS implementation? If not, it would be great to have them, ideally for the latest version of ActiveMQ (Artemis).
I've come across a few efforts initiated in the past to add support and/or document how to integrate ActiveMQ into Open Liberty, but I was not able to find the fruits of this work: