In this scenario we intend to send a
message from system1 to system3 via system2, i.e., not directly but through hopping. We need three queue managers (QMGR1, QMGR2, QMGR3) in three different systems. When we put
message in remote queue of system1 it hops through the remote queue of
second queue and lands in local queue of system3. Inorder to achieve this, we need to create channels, listeners and queues, in each queue manager, as explained in the below hierarchy.
SYSTEM1:
|
SYSTEM2
|
SYSTEM3
|
1.QMGR1(queue manager)
|
1.QMGR2(queue manager)
|
1.QMGR3(queue manager)
|
2.LSTNR1(listener)
|
2.LSTNR2(listener)
|
2.LSTNR3(listener)
|
3.TRNSQ1(transmission queue)
|
3.TRNSQ2(transmission queue)
|
3.LQ(local queue)
|
4.RMTQ1(remote queue)
|
4.RMTQ2(remote queue)
|
4.QMGR2_TO_QMGR3(receiver channel)
|
5.QMGR1_TO_QMGR2(sender channel)
|
5.QMGR1_TO_QMGR2(receiver channel)
|
|
6.QMGR2_TO_QMGR3(sender channel)
|
- Create and start a queue manager in all the three systems using the following commands
- CRTMQM QMGR1<------to create a queue manager
- STRMQM QMGR1<------to start a queue manager
- Create a listener,transmission queue,remote queue and a sender channel in system1 using the following commands
- RUNMQSC QMGR1 <-- opens a window to issue commands specific to the queue manager
- DEFINE LISTENER (LSTNR1) TRPTYPE (TCP) PORT(PORT NUMBER) <-- to create a listener
- DEFINE QLOCAL(TRNSQ1) USAGE(XMITQ) <-- to create a transmission queue
- DEFINE QREMOTE(RMTQ1) RNAME(RMTQ2) RQMNAME(QMGR2) XMITQ(TRNSQ1) <--to create remote queue
- DEFINE CHANNEL(QMGR1_TO_QMGR2) CHLTYPE(SDR)CONNAME('QMGR2_HOSTNAME(PORT NUMBER)') XMITQ(TQ) <- to create sender channel
- Create a listener,transmission queue,remote queue,receiver channel, sender channel in system2 using following commands
- RUNMQSC QMGR2 <-- opens a command window to issue commands specific to the queue manager
- DEFINE LISTENER (LSTNR2) TRPTYPE (TCP) PORT(PORT NUMBER) <-- to create a listener
- DEFINE QLOCAL(TRNSQ2) USAGE(XMITQ) <-- to create a transmission queue
- DEFINE QREMOTE(RMTQ2) RNAME(LQ) RQMNAME(QMGR3) XMITQ(TRNSQ2) <-- to create remote queue
- DEFINE CHANNEL(QMGR1_TO_QMGR2) CHLTYPE(RVCR) TRPTYPE(TCP) <-- to create the receiver channel
- DEFINE CHANNEL (QMGR2_TO_QMGR3) CHLTYPE(SDR)CONNAME('QMGR3_HOSTNAME(PORT- NUMBER)') XMITQ(TRNSQ2) <- to create sender channel
- Create listener,receiver channel,local queue in system3 using following commands
- DEFINE LISTENER (LSTNR3) TRPTYPE (TCP) PORT(PORT NUMBER) <-- to create a listener
- DEFINE CHANNEL(QMGR2_TO_QMGR3) CHLTYPE(RVCR) TRPTYPE(TCP) <-- to create the receiver channel
- DEFINE QLOCAL(LQ) <-- to create the local queue
- Start the listener and channels in every system using the following commands
- START LISTENER(LISTENER_NAME)<----to start listener
- START CHANNEL(CHANNEL_NAME)<------to start the channel
- Put the message in remote queue of first system
- AMQSPUT RQ QMGR1 <-- after this type your message and double click enter
- Get the message from the system3
- AMQSGET LQ QMGR2 <-- you can see the message which is transmitted in the system1
No comments :
Post a Comment