Question & Answer
Question
How do you connect to Apache ActiveMQ with IBM Rational Integration Tester (RIT) of IBM Rational Test Workbench?
Cause
You want to use Apache ActiveMQ to send and receive messages. ActiveMQ does not provide a full Java Naming and Directory Interface (JNDI) server. Therefore additional configuration steps are required in RIT.
Answer
Consult the Apache ActiveMQ documentation and the RIT Java Message Service documentation.
Also consult your ActiveMQ administrator for connection details.
This example shows a topic connection using connection factory name TopicConnectionFactory on server activemqserver and topic MyTopic.
You first need to obtain the activemq-all-<version>.jar
file where the version matches that of your ActiveMQ server. Additionally you need to create or copy an ActiveMQ JNDI definition file jndi.properties
to the RIT system. A sample follows:
# START SNIPPET: jndi
java.naming.factory.initial = org.apache.activemq.jndi.ActiveMQInitialContextFactory
# use the following property to configure the default connector
#java.naming.provider.url = vm://localhost
java.naming.provider.url = tcp://activemqserver:61616
# use the following property to specify the JNDI name the connection factory
# should appear as.
#connectionFactoryNames = connectionFactory, queueConnectionFactory, topicConnectionFactry
connectionFactoryNames = TopicConnectionFactory
# register some queues in JNDI using the form
# queue.[jndiName] = [physicalName]
queue.MyQueue = example.MyQueue
# register some topics in JNDI using the form
# topic.[jndiName] = [physicalName]
topic.MyTopic = MyTopic
# END SNIPPET: jndi
Consider the following configuration steps.
- Exit RIT.
- Open Library Manager and click JMS.
- Add a new provider and add the files
activemq-all-<version>.jar
andjndi.properties
.
- Click the check box to enable this provider.
- Click OK to save and exit Library Manager.
- Start RIT and create a JMS transport in Logical View of Architecture School.
Right-click to edit the physical transport. Configure JNDI Settings as follows.
Initial Context Factory:org.apache.activemq.jndi.ActiveMQInitialContextFactory
(manually entered)
Provider URLs:tcp:<hostname>:<port>
e.g.tcp://activemqservert:61616
- Add the following to Properties.
topic.<JNDI topic name>
(type String) - value of physical topic name
Here is an example.
- Configure Connection Settings.
- Use the transport in your tests.
Was this topic helpful?
Document Information
Modified date:
29 September 2018
UID
swg21636686