Configuring the JMS Router

JMS Router Configuration

Part of the Oracle Enterprise Messaging System that ships with Oracle Containers for J2EE (OC4J) is the JMS Router.  Last week I had occasion to talk to one of our support engineers who expressed confusion about why anyone would want to use the JMS Router.  So what is it for and how do you use it.

Router Use Case

There are others but a common use case is to connect two dissimilar routing technologies.  For example we may want to move messages from an Oracle AQ domain into an IBM MQ domain.  This is useful because AQ is strong at providing a secure message system inside the database.  If AQ is unavailable then the database is probably down as well so the clients probably can't put messages onto the queue, so AQ is a great place to put messages before transferring them to other domains.  MQ is often installed as a messaging backbone in a corporation, I remember using it 10 years ago on AIX and TPF.
Moving messages from AQ to MQ then provides an application a secure way to transfer messages from a database centric domain to a messaging backbone.  If MQ is down then the router will keep trying to transfer the messages until MQ is back up.  This is achieved without the need for costly MQ Server software on every application server, only AQ in the database server needs licensing, there are no license costs to use AQ from the mid-tier systems.

Setting up JMS Router

So how do we set up the JMS router.  Using the Oracle Enterprise Manager web based JMX console we navigate to the JMS configuration (select Administration and then JMS Destinations) and ensure that we have two queues.  For initial testing I created a second queue located at jms/demoQueue2 - I made it a memory based queue.
I found that I also needed to set up a log queue called jms/Queues/OracleASRouter_LOGQ.  This is used by the JMS Router.
I then navigated to the JMX Router configuration (select Administration, then Oracle JMS Router and finally operations) and created a new router job (addRouterJob).  The name of the job is arbitary but it is mandatory to provide the following four properties.
  • message-source (jms/demoQueue the from queue)
  • source-connection-factory (jms/ConnectionFactory the from connection factory)
  • message-target (jms/demoQueue2 the to queue)
  • target-connection-factory (jms/ConnectionFactory the to connectin factory)
If you don't specify a log queue for the source and/or target then the router will use jms/Queues/OracleASRouter_LOGQ by default - hence the need to create it earlier.
Any messages placed on jms/demoQueue will now be transferred to jms/demoQueue2.
The next trick is to replace jms/demoQueue2 with a non-Oracle messaging system.  I will return to this later.  in the eantime enjoy moving messages around.

Comments:

It is true that the purpose of the JMS Router often eludes people - thanks for helping clearing that up! I often summarize the mission of the JMS Router as being to bridge:
1- destinations (ex: Topic T1 to Queue Q1)
2- vendors (ex: Oracle to IBM - as described in your post)
3- geographies (ex: forward, selectively and over HTTPS, some JMS traffic from the US to EMEA)

Posted by Demed L'Her on March 21, 2007 at 11:58 PM MDT #

Hi.
I need send messages to the queue "jms/demoQueue2" on other container.
How can do it? Where I put the IP and the port of destination?
Thanks.

Posted by Phas on July 11, 2011 at 11:19 AM MDT #

Post a Comment:
Comments are closed for this entry.
About

Musings on Fusion Middleware and SOA Picture of Antony Antony works with customers across the US and Canada in implementing SOA and other Fusion Middleware solutions. Antony is the co-author of the SOA Suite 11g Developers Cookbook, the SOA Suite 11g Developers Guide and the SOA Suite Developers Guide.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today