1. Resource Context Client Configuration
Apache ActiveMQ Artemis provides support for configuring the client in the context.xml
of the Tomcat container.
This is very similar to the way this is done in ActiveMQ “Classic” so anyone migrating should find this familiar. Please note though the connection url and properties that can be set for ActiveMQ Artemis are different please see Migration Documentation
1.1. Example of Connection Factory
<Context>
...
<Resource name="jms/ConnectionFactory" auth="Container" type="org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory" description="JMS Connection Factory"
factory="org.apache.activemq.artemis.jndi.JNDIReferenceFactory" brokerURL="tcp://localhost:61616" />
...
</Context>
1.2. Example of Destination (Queue and Topic)
<Context>
...
<Resource name="jms/ExampleQueue" auth="Container" type="org.apache.activemq.artemis.jms.client.ActiveMQQueue" description="JMS Queue"
factory="org.apache.activemq.artemis.jndi.JNDIReferenceFactory" address="ExampleQueue" />
...
<Resource name="jms/ExampleTopic" auth="Container" type="org.apache.activemq.artemis.jms.client.ActiveMQTopic" description="JMS Topic"
factory="org.apache.activemq.artemis.jndi.JNDIReferenceFactory" address="ExampleTopic" />
...
</Context>
2. Example Tomcat App
A sample Tomcat app with the container context configured as an example can be seen here:
/examples/features/sub-modules/tomcat