Distributed Two Way MQ Communication — Part2

Refer the Below Link for more details on Distributed MQ communication Part 1:
http://webspherepundit.com/?p=1608

Requirement : To set up a minimal steps for a Two Way MQ communication between two queue managers ie From QMC01 to  QMC02 & From Qmc02 to QMC01

Architecture :
OS : Linux Redhat 5.6
MQ Version : 7.0

Infrastructure Diagram :

TwoWayMQDistributed_Communiction

HighLevel Steps for Two Way Distributed Communication with Two Queue Manager :

TwoWayMQDistributed_Communiction1

Quick References commands for Two Way MQ Communication :

ON Queue Manager QMC01
As mqm user
—– Create the Queue Manager QMC01
bash-3.2$crtmqm QMC01
—–Start Queue Manager QMC01
bash-3.2$strmqm QMC01

—–Launch MQSC prompt for QMC01
bash-3.2$runmqsc QMC01

—–Create the Transmission Queue as the same name as Dest Qmgr as a best practice
DEF QL(QMC02) REPLACE USAGE(XMITQ)

—–Create the Sender Channel from QMC01 to QMC02 where 9002 is the listening port on Dest Qmgr QMC02
DEF CHL(QMC01.QMC02) CHLTYPE(SDR) REPLACE TRPTYPE(TCP) CONNAME(‘10.0.0.20(9002)’) XMITQ(QMC02)

—–Create a Receiver channel from QMC02 to QMC01 (we are creating a two way communication)
DEF CHL(QMC02.QMC01) CHLTYPE(RCVR) REPLACE TRPTYPE(TCP)

—–Create a Local Queue as the Dead Letter Queue
DEF QL(DLQ) REPLACE

—–Modify the DEADQ attribute of qmgr to use the Qlocal created above
ALTER QMGR DEADQ(DLQ)

—–Create Listener on Qmgr QMC01 with listen port as 9001
DEFINE LISTENER(QMC01.LISTENER) TRPTYPE(TCP) PORT(9001) IPADDR(10.0.0.20)

—–Start the listener on QMC01 
START LISTENER(QMC01.LISTENER)

—–DISPLAY the listener Status on QMC01
DISPLAY LSSTATUS (QMC01.LISTENER)

—–Start Sender Channel QMC01.QMC02
START CHL(QMC01.QMC02)

—–Check Ping Status
PING CHL(QMC01.QMC02)

—–Check Channel Status
DISPLAY CHSTATUS(QMC01.QMC02)

DISPLAY CHSTATUS(QMC02.QMC01)

—–Define Remote Queue Definitions (QRMT02) to Local Queue QL.A which is on QMC02
DEF QR(QRMT02) REPLACE RNAME(QL.A) RQMNAME(QMC02) XMITQ(QMC02)

—–Define Local Queue QL.B for the messages put from QMC02
DEF QL(QL.B) REPLACE

###############################################################

###############################################################

ON Queue Manager QMC02

—– Create the Queue Manager QMC01
bash-3.2$crtmqm QMC02

—–Start Queue Manager QMC01
bash-3.2$strmqm QMC02

—–Launch MQSC prompt for QMC01
bash-3.2$runmqsc QMC02

—–Create the Transmission Queue as the same name as Dest Qmgr as a best practice
DEF QL(QMC01) REPLACE USAGE(XMITQ)

—–Create the Sender Channel from QMC02 to QMC01 where 9001 is the listening port on Dest Qmgr QMC01
DEF CHL(QMC02.QMC01) CHLTYPE(SDR) REPLACE TRPTYPE(TCP) CONNAME(‘10.0.0.20(9001)’) XMITQ(QMC01)

—–Create a Receiver channel from QMC02 to QMC01 (we are creating a two way communication)
DEF CHL(QMC01.QMC02) CHLTYPE(RCVR) REPLACE TRPTYPE(TCP)

—–Create a Local Queue as the Dead Letter Queue
DEF QL(DLQ) REPLACE

—–Modify the DEADQ attribute of qmgr to use the Qlocal created above
ALTER QMGR DEADQ(DLQ)

—–Create Listener on Qmgr QMC02 with listen port as 9002
DEFINE LISTENER(QMC02.LISTENER) TRPTYPE(TCP) PORT(9002) IPADDR(10.0.0.20)

—–Start the listener on QMC02
START LISTENER(QMC02.LISTENER)

—–DISPLAY the listener Status on QMC02
DISPLAY LSSTATUS (QMC02.LISTENER)

—–Start Sender Channel QMC02.QMC01
START CHL(QMC02.QMC01)

—–Check Ping Status
PING CHL(QMC02.QMC01)

—–Check Channel Status
DISPLAY CHSTATUS(QMC01.QMC02)

DISPLAY CHSTATUS(QMC02.QMC01)

—–Define Local Queue QL.A for the messages put from QMC01
DEF QL(QL.A) REPLACE

—–Define Remote Queue Definitions (QRMT01) to Local Queue QL.B which is on QMC01
DEF QR(QRMT01) REPLACE RNAME(QL.B) RQMNAME(QMC01) XMITQ(QMC01)

###############################################################

###############################################################
Testing for Two Way MQ communication

—–On QMC01 Put message on QRemote QRMT02
bash-3.2$/opt/mqm/samp/bin/amqsput QRMT02 QMC01

—–On QMC02 get message on Qlocal QL.A
bash-3.2$/opt/mqm/samp/bin/amqsget QL.A QMC02

 

—–On QMC02 Put message on QRemote QRMT01
bash-3.2$/opt/mqm/samp/bin/amqsput QRMT01 QMC02

—–On QMC01 get message on Qlocal QL.B
bash-3.2$/opt/mqm/samp/bin/amqsget QL.B QMC01

 

Troubleshooting

Step 1: Ensure that Sender Channel in the Source Qmgr and Listener and Reciever Channel in the Destination Qmgr is started and running

Step 2: The Sender channel Name in the Source Qmgr  the  Receiver channel Name in the destination Qmgr should have the same name

Step 3: The Listener port shouldn’t be used by any other application

Step 4: Recheck the configurations done

Step 5: Check if the message is there in the transmission queue

 

 

To get automated mail updates of my Posts..
Please subscribe to the site http://webspherepundit.com
And also like the Facebook Page
https://www.facebook.com/webspherepundit

 

Leave a Reply

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