How can I use WebSphere Message broker instance to route messages between queues residing in two queue managers. The message broker instance can only be associated with one queue manager during creation time. So I create an MQInputNode and put messages to the specific source queue. My concern is to route this message to second queue residing in another queue manager using the same broker instance. How? I am using WebSphere Message Broker version 8.0.0.8. Not yet into IIB.
Below is a simple and efficient way of doing it.
Suppose, your broker is on QM1. You have a local queue in QM2 named LQ_QM2. And you want the messages to go to LQ_QM2. Follow below steps:
- At QM1, create a local queue of usage 'Transmission'. Let us name this transmission queue as "QM2".
- At QM1, create a sender channel named "QM1.QM2" with proper connection name (Contains host(port) of target queue manager, for eg 10.1.5.2(1144)) and set transmission queue as QM2 (The one we created in step 1).
- Create a receiver channel at QM2 named "QM1.QM2).
- Now create a remote queue definition at QM1. Let's name it as RQ_LQ_QM2. Set remote queue property as LQ_QM2 and transmission queue as QM2 and remote queue manager as QM2.
- The messages which you want to send to the queue LQ_QM2 can now be written by the broker to RQ_LQ_QM2 in QM1 itself.
If you can't do the above MQ stuff and must use only Message broker capability then the way of doing it in WMB 8 would be to use Java and write an MQ client code using the MQ API libraries. You will then establish remote connection with the remote queue manager using SVRCONN channel and put messages on the remote queue manager's queue.