The following example describes how to connect Apache ActiveMQ 5.x to Rhapsody using the JMS communication point:
Apache Active MQ Configuration
Installing the software
- Download the appropriate version of Apache ActiveMQ and install it.
- To get started with Apache ActiveMQ, refer to Getting Started Guide.
Starting the Domain
Start the following components:
- Server - in order to start the AdminServer, run the command
ApacheMQ_HOME\bin\activemq start
. - Administration Console - navigate to
http://localhost:8161/admin
and enter the user and password (admin and
admin
, respectively).
Configuring JMS Resources
- Navigate to Queues.
Enter
rhapsodyQueue
in the Queue Name field:- Select the Create button.
The details of the new queue is displayed:
Rhapsody Configuration
Rhapsody IDE Route Configuration
Login to the Rhapsody IDE and configure a route including a JMS communication point and a destination where you want the message to reside.
In this example, an input JMS communication point is used to read messages from the Apache ActiveMQ JMS Queue and send the messages to the Hold Queue in Rhapsody. For details on the JMS communication point and managing routes, refer to JMS (Java Message Service) and Configuring Routes, respectively.
JMS Communication Point Configuration
Configuration
For the purposes of this example, the configuration properties for the JMS communication point are set as follows:
Property | Value |
---|---|
Implementation | JNDI |
InitialContextFactory | org.apache.activemq.jndi.ActiveMQInitialContextFactory |
ProviderURL | tcp://localhost:61616 |
Queue Connection Factory |
QueueConnectionFactory |
Connection Username |
admin |
Connection Password |
admin |
Custom Parameters | Name = queue.rhapsodyQueue , Value = rhapsodyQueue |
Input Destination | rhapsodyQueue |
Input Destination Type |
Queue |
Receiving Mode | Polling |
Auxiliary Files
In order to make the JMS communication point work, you include the Apache ActiveMQ JMS clients. These files are located in ApacheMQ_HOME\lib
. The following JAR files are required:
Testing
Check-in Changes, Starting the Route and Communication Point
Once the components in Rhapsody are configured, you can check them in and start them. From the Management Console, check the route and the JMS communication point status:
Sending Messages to the Apache ActiveMQ JMS Queue
- From the Administration Console, navigate to Send a JMS Message.
- Enter
rhapsodyQueue
in the Destination field. - For the purposes of this example, select
Queue
(but eventually you might selectTopic
if you have configured one in your environment). - Enter the necessary fields.
- Select the Send button.
Management Console
The Management Console will display the message consumed by the communication point and sent to the Hold Queue. Navigate to Monitoring>Monitoring the Hold Queue and select the message processed by the JMS communication point to display in it Message View: