Thanks for visiting the site !!! Visit below intrested Ads to support us if you like the site .Sharing is caring .keep distance and keep safe . Happy Learning ... 😀

Passing the messages through multiple qmgr’s to reach Destination QMGR is called MultiHopping .

Example TEST.QM1 -> TEST.QM2 -> TEST.QM3 -> TEST.GM4

In General if we have 2 QMGR’S then to pass message from TEST.QM1 to TEST.QM2 we need Sender ,Receiver channel ,Xmitq,Remote Queue and a Local Queue .
In our case we have 2 QMGR’s in between TEST.QM1 and TEST.QM4. TEST.QM2 & TEST.QM3 will need a queue-manager aliases since they are non-adjacent (don’t have a transmission queue) to the destination QMGR.

MultiHopping

Definitions required for TEST.QM1

crtmqm TEST.QM1
strmqm TEST.QM1
DEFINE LISTENER(QM1.LST) TRPTYPE(TCP) PORT(1414) CONTROL(QMGR) 
START LISTENER(QM1.LST)
DEFINE QL(QM1.XMITQ) USAGE(XMITQ)
DEFINE CHANNEL(QM1.TO.QM2) CHLTYPE(SDR) TRPTYPE(TCP) CONNAME('172.31.14.154(1415)') XMITQ(QM1.XMITQ)
DEFINE QR(SOURCEQR) RNAME(DESTQL) RQMNAME(TEST.QM4) XMITQ(QM1.XMITQ)
define ql(DEADQL)
ALTER QMGR DEADQ(DEADQL)
start CHANNEL(QM1.TO.QM2)
TEST.QM1 Result
===============
DEFINE LISTENER(QM1.LST) TRPTYPE(TCP) PORT(1414) CONTROL(QMGR) 
     1 : DEFINE LISTENER(QM1.LST) TRPTYPE(TCP) PORT(1414) CONTROL(QMGR) 
AMQ8626I: IBM MQ listener created.
START LISTENER(QM1.LST)
     6 : START LISTENER(QM1.LST)
AMQ8021I: Request to start IBM MQ listener accepted.
DEFINE QL(QM1.XMITQ) USAGE(XMITQ)
     7 : DEFINE QL(QM1.XMITQ) USAGE(XMITQ)
AMQ8006I: IBM MQ queue created.
DEFINE CHANNEL(QM1.TO.QM2) CHLTYPE(SDR) TRPTYPE(TCP) CONNAME('172.31.14.154(1415)') XMITQ(QM1.XMITQ)
     4 : DEFINE CHANNEL(QM1.TO.QM2) CHLTYPE(SDR) TRPTYPE(TCP) CONNAME('172.31.14.154(1415)') XMITQ(QM1.XMITQ)
AMQ8014I: IBM MQ channel created.
DEFINE QR(SOURCEQR) RNAME(DESTQL) RQMNAME(QM4) XMITQ(M1.XMITQ)
     5 : DEFINE QR(SOURCEQR) RNAME(DESTQL) RQMNAME(QM4) XMITQ(M1.XMITQ)
AMQ8006I: IBM MQ queue created.
START LISTENER(QM1.LST)
     6 : START LISTENER(QM1.LST)
AMQ8021I: Request to start IBM MQ listener accepted.
start chl(QM1.TO.QM2) 
     3 : start chl(QM1.TO.QM2) 
AMQ8018I: Start IBM MQ channel accepted.
define ql(DEADQL)
     2 : define ql(DEADQL)
AMQ8006I: IBM MQ queue created.
ALTER QMGR DEADQ(DEADQL)
     3 : ALTER QMGR DEADQ(DEADQL)
AMQ8005I: IBM MQ queue manager changed.

Definitions required for TEST.QM2

crtmqm TEST.QM2
strmqm TEST.QM2
DEFINE LISTENER(QM2.LST) TRPTYPE(TCP) PORT(1415) CONTROL(QMGR) 
START LISTENER(QM2.LST)
DEFINE QL(QM2.XMITQ) USAGE(XMITQ)
DEFINE CHANNEL(QM1.TO.QM2) CHLTYPE(RCVR) TRPTYPE(TCP)
DEFINE CHANNEL(QM2.TO.QM3) CHLTYPE(SDR) TRPTYPE(TCP) CONNAME('172.31.14.154(1416)') XMITQ(QM2.XMITQ)
DEFINE QR(TEST.QM4) RNAME('') RQMNAME(TEST.QM4) XMITQ(QM2.XMITQ)
start CHANNEL(QM2.TO.QM3)
TEST.QM2 Result
===============

DEFINE LISTENER(QM2.LST) TRPTYPE(TCP) PORT(1415) CONTROL(QMGR) 
     1 : DEFINE LISTENER(QM2.LST) TRPTYPE(TCP) PORT(1415) CONTROL(QMGR) 
AMQ8626I: IBM MQ listener created.
START LISTENER(QM2.LST)
     2 : START LISTENER(QM2.LST)
AMQ8021I: Request to start IBM MQ listener accepted.
DEFINE QL(QM2.XMITQ) USAGE(XMITQ)
     3 : DEFINE QL(QM2.XMITQ) USAGE(XMITQ)
AMQ8006I: IBM MQ queue created.
DEFINE CHANNEL(QM1.TO.QM2) CHLTYPE(RCVR) TRPTYPE(TCP)
     4 : DEFINE CHANNEL(QM1.TO.QM2) CHLTYPE(RCVR) TRPTYPE(TCP)
AMQ8014I: IBM MQ channel created.
DEFINE CHANNEL(QM2.TO.QM3) CHLTYPE(SDR) TRPTYPE(TCP) CONNAME('172.31.14.154(1416)') XMITQ(QM2.XMITQ)
     5 : DEFINE CHANNEL(QM2.TO.QM3) CHLTYPE(SDR) TRPTYPE(TCP) CONNAME('172.31.14.154(1416)') XMITQ(QM2.XMITQ)
AMQ8014I: IBM MQ channel created.
DEFINE QR(QM4) RNAME('') RQMNAME(QM4) XMITQ(QM2.XMITQ)
     7 : DEFINE QR(QM4) RNAME('') RQMNAME(QM4) XMITQ(QM2.XMITQ)
AMQ8006I: IBM MQ queue created.
start chl(QM2.TO.QM3) 
     3 : start chl(QM2.TO.QM3) 
AMQ8018I: Start IBM MQ channel accepted.

Definitions required for TEST.QM3

crtmqm TEST.QM3
strmqm QM3
DEFINE LISTENER(QM3.LST) TRPTYPE(TCP) PORT(1416) CONTROL(QMGR) 
START LISTENER(QM3.LST)
DEFINE QL(QM3.XMITQ) USAGE(XMITQ)
DEFINE CHANNEL(QM2.TO.QM3) CHLTYPE(RCVR) TRPTYPE(TCP)
DEFINE CHANNEL(QM3.TO.QM4) CHLTYPE(SDR) TRPTYPE(TCP) CONNAME('172.31.14.154(1417)') XMITQ(QM3.XMITQ)
DEFINE QR(TEST.QM4) RNAME('') RQMNAME(TEST.QM4) XMITQ(QM3.XMITQ)
start CHANNEL(QM2.TO.QM3)
TEST.QM3 Results
===============
DEFINE LISTENER(QM3.LST) TRPTYPE(TCP) PORT(1416) CONTROL(QMGR) 
     3 : DEFINE LISTENER(QM3.LST) TRPTYPE(TCP) PORT(1416) CONTROL(QMGR) 
AMQ8626I: IBM MQ listener created.
START LISTENER(QM3.LST)
     4 : START LISTENER(QM3.LST)
AMQ8021I: Request to start IBM MQ listener accepted.
DEFINE QL(QM3.XMITQ) USAGE(XMITQ)
     5 : DEFINE QL(QM3.XMITQ) USAGE(XMITQ)
AMQ8006I: IBM MQ queue created.
DEFINE CHANNEL(QM2.TO.QM3) CHLTYPE(RCVR) TRPTYPE(TCP)
     6 : DEFINE CHANNEL(QM2.TO.QM3) CHLTYPE(RCVR) TRPTYPE(TCP)
AMQ8014I: IBM MQ channel created.
DEFINE CHANNEL(QM3.TO.QM4) CHLTYPE(SDR) TRPTYPE(TCP) CONNAME('172.31.14.154(1417)') XMITQ(QM3.XMITQ)
     7 : DEFINE CHANNEL(QM3.TO.QM4) CHLTYPE(SDR) TRPTYPE(TCP) CONNAME('172.31.14.154(1417)') XMITQ(QM3.XMITQ)
AMQ8014I: IBM MQ channel created.
DEFINE QR(QM4) RNAME('') RQMNAME(QM4) XMITQ(QM3.XMITQ)
     8 : DEFINE QR(QM4) RNAME('') RQMNAME(QM4) XMITQ(QM3.XMITQ)
AMQ8006I: IBM MQ queue created.
start chl(QM3.TO.QM4) 
     3 : start chl(QM3.TO.QM4) 
AMQ8018I: Start IBM MQ channel accepted.

Definitions required for TEST.QM4

crtmqm TEST.QM4
strmqm TEST.QM4
DEFINE LISTENER(QM4.LST) TRPTYPE(TCP) PORT(1417) CONTROL(QMGR) 
START LISTENER(QM4.LST)
DEFINE CHANNEL(QM3.TO.QM4) CHLTYPE(RCVR) TRPTYPE(TCP) 
DEFINE QLOCAL(DESTQL)
TEST.QM4 Results
===============
DEFINE LISTENER(QM4.LST) TRPTYPE(TCP) PORT(1417) CONTROL(QMGR) 
     3 : DEFINE LISTENER(QM4.LST) TRPTYPE(TCP) PORT(1417) CONTROL(QMGR) 
AMQ8626I: IBM MQ listener created.
START LISTENER(QM4.LST)
     4 : START LISTENER(QM4.LST)
AMQ8021I: Request to start IBM MQ listener accepted.
DEFINE CHANNEL(QM3.TO.QM4) CHLTYPE(RCVR) TRPTYPE(TCP) 
     5 : DEFINE CHANNEL(QM3.TO.QM4) CHLTYPE(RCVR) TRPTYPE(TCP) 
AMQ8014I: IBM MQ channel created.
DEFINE QLOCAL(DESTQL)
     6 : DEFINE QLOCAL(DESTQL)
AMQ8006I: IBM MQ queue created.

Now test by sending message in TEST.QM1 SOURCEQR . message should arrive in DESTQL on TEST.QM4

[mqm@ip-172-31-14-154 bin]$ /opt/mqm/samp/bin/amqsput SOURCEQR TEST.QM1
Sample AMQSPUT0 start
target queue is SOURCEQR
AAAAA
BBBBB
CCCCC
DDDDD
EEEEE
Sample AMQSPUT0 end
[mqm@ip-172-31-14-154 bin]$

Verify the message received on TEST.QM4 DESTQL queue .

[mqm@ip-172-31-14-154 bin]$ /opt/mqm/samp/bin/amqsget DESTQL TEST.QM4
Sample AMQSGET0 start
message <AAAAA>
message <BBBBB>
message <CCCCC>
message <DDDDD>
message <EEEEE>
no more messages
Sample AMQSGET0 end
[mqm@ip-172-31-14-154 bin]$ 

Hope this clarify MQ Hopping Technique with MQGR alias …

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *