products versions - webMethods Integration Server version: 10.15
Introduction
Apache ActiveMQ Artemis is a Message Broker. It has its origins in JBoss HornetQ project.
It supports multiple protocols:
- Artemis / HornetQ Native
- MQTT
- AMQP
- STOP
- OpenWire
It supports connectivity using JMS. For the purpose of this configuration, JMS API is used along with Artemis native protocol.
Apache ActiveMQ Artemis implements a client side JNDI implementation. This implementation requires declaring queues and other properties as part of JNDI configuration on the client.
Note: As per SAG documentation as well as my interaction with support engineers, any JMS client library following JMS 1.1 should work. SAG does not test every JMS broker. Please make sure to test set up sufficiently prior to deploying it in production environment.
Pre-requisite
- Apache ActiveMQ Artemis version 2.27.1 installed and running.
- The server should be listening for artemis protocol on a given port. The example uses port 61616 (default port set up by Apache ActiveMQ Artemis)
- Queue created in Artemis
- For the Proof-of-concept, the queue is called
FirstQueue
.
- For the Proof-of-concept, the queue is called
- Integration Server 10.15 installed and running.
- Administrator user is required for JNDI / JMS Configuration
- Designer 10.15 installed and running. Connected to Integration Server.
- Artemis client jar file (Steps for client-all jar provided below)
Steps to follow
Integration Server Configuration
- Download
artemis-jms-client-all-2.27.1.jar
(see Useful link below)
Note: Artemis jar file combines multiple dependencies into a fatjar. This may cause class conflict with existing jar files loaded on Integration Server environment. Please read thru Artemis documentation in detail. The alternative would be to import individual jars and if there is a conflict, isolate and upgrade conflicted jar file and test to see if end solution still works.
- Copy jar file into Integration Server’s lib/jars/custom folder. e.g.
/opt/softwareag/IntegrationServer/instances/default/lib/jars/custom
(Refer to Integration Server Administration Guide) - Restart Integration Server
JNDI Alias
Create a new JNDI Setting using Integration Server console.
Provide settings as below:
- JNDI Alias Name:
ArtemisJNDI
- Description:
Artemis
- Initial Context Factory:
org.apache.activemq.artemis.jndi.ActiveMQInitialContextFactory
- Provider URL:
tcp://<server.name>:61616
- Other properties:
queue.queues/FirstQueue=FirstQueue
Key Information:
Artemis does not implement server side JNDI. As a result, it is important to define names of the queues in Other properties.
- Click Save changes
- Click on Test Lookup button to review / validate JNDI settings.
JMS Setting
Create a JMS Alias
- Create a new connection alias using standard JMS Alias step
- In Connection Protocol Settings → Create Connection using → JNDI Lookup
- Choose JNDI Alias created in step above
- Set Connection Factory Lookup Name as
QueueConnectionFactory
orConnectionFactory
.
Using it in Designer
Reading Messages from JMS queue
Create a JMS Trigger
- set JMS Connection Alias with same value as created in JMS setting
- set Destination Name as
queues/FirstQueue
- set Destination Type as
queue
Sending a Message into JMS
Add steps to flow service
- add pub.jms:send to flow service
- map connectionAlias created in JMSsetting
- map destinationName as
queues/FirstQueue
. - map destinationType as
QUEUE
.
Next steps
- Run Test by sending messages into Artemis.
Useful links | Relevant resources
- Documentation and link to download JMS client The Client Classpath
- Client Side JNDI Using JMS | ActiveMQ Artemis Documentation