Distributed MQ Channel Setup – Single Way communication

Requirement : To set up a minimal steps for a Single way MQ communication between two queue managers ie From QMC01 to  QMC02

Architecture :
OS : Linux Redhat 5.6
MQ Version : 7.0
Source Qmgr :  QMC01
Destination Qmgr : QMC02 ( Both the Qmgrs on same IP)

Infrastructure Diagram :

distributed communication

High level Steps create the Single WAY MQ  communication between QMGRs :

Destination QMGR
Step1:  Create the Destination QMGR
Step2: Create Local queue where the message needs to be received
Step3: Define Listener and Start the Listener
Step4: Creating Receiver Channel with same name as the Sender channel
Step5: Start the Receiver Channel

Source QMGR
Step1: Create the qmgr
Step2: Define Transmission Queue
Step3: Creating Sender Channel
Step4: Create Remote Queue Definitions
Step5: Start the Sender Channel

######################################################################################
                         Detailed Steps
######################################################################################

 Destination QueueManager
Step1: Create a Destination Queue Manager QMC02

bash-3.2$ crtmqm QMC02

Step2:  Start the Queue Manager QMC02

bash-3.2$ strmqm QMC01

Step3:  Enter the Mqsc prompt of QMC02

bash-3.2$ runmqsc QMC01

Step4: Create the Local Queue in the Dest Qmgr where the message is to be received from the Source Qmgr Qmc01

DEFINE QLOCAL(QL.A)

Step5:  Define Listener for Source Qmgrs to connect to Dest Qmgrs

DEFINE LISTENER(QMC02.LISTENER) TRPTYPE(TCP) PORT(1414) IPADDR(192.168.111.128)

Step6: Start Listeners (QMC02.LISTENER) on the Dest Qmgr QMC02

START LISTENER(QMC02.LISTENER)


NOTE : Listener can be started by the command line to as mentioned below

/opt/mqm/bin/runmqlsr -r -m QMC02 -t TCP -p 1414 -i 192.168.111.128

Step7: Define the Receiver Channel CHL(QMC01.QMC02)

DEFINE CHL(QMC01.QMC02) CHLTYPE(RCVR) REPLACE TRPTYPE(TCP)

Step8: Start the Receiver Channel

START CHANNEL(QMC01.QMC02)

Step9: Display Listener Status

DISPLAY LSSTATUS (QMC02.LISTENER)

Step10: Display Receiver Channel Status

DISPLAY CHSTATUS(QMC01.QMC02)

Step11: Check if the listener is running on the Destination Qmgr server

ps -ef | grep runmqlsr

 

Screenshots for commands

MQcommunication1

 

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

 Source QueueManager
Step1: Create the source queue manager QMC01

bash-3.2$ crtmqm QMC01

Step2: Start the Queue Manager  QMC01

bash-3.2$ strmqm QMC01

Step3: Enter the MQSC prompt of the QMC01

bash-3.2$ runmqsc QMC01

Step4: Create the Transmision Queue : QMC02.XMITQ 

DEFINE QLOCAL(QMC02.XMITQ) REPLACE USAGE(XMITQ)

Step5: Create the Sender Channel QMC01.QMC02  with these details
a)  CHLTYPE and TRPTYPE ( as we are using TCP protocol for connection )
b) CONNAME ( Use the Ip address of the Destination QMgr and the port of the Dest Listener)
c) XMITQ ( Use the Transmission Queue for the senders channel )

NOTE : The Sender Channel Name created here should be same as the Receive Channel created for the Destination QMgr QMC02

Usually the naming  convention is source.to.destination for ease of understanding the infra

DEFINE CHANNEL(QMC01.QMC02) CHLTYPE(SDR) REPLACE TRPTYPE(TCP) CONNAME(‘192.168.111.128(1414)’) XMITQ(QMC02.XMITQ)

Step6: Define the Remote Queue Definitions with Remote Queue Name and Remote Qmgr Name

DEFINE QREMOTE(QRMT02) RNAME(QL.A) RQMNAME(QMC02) XMITQ(QMC02.XMITQ)

Step7: Start the Sender Channel QMC01.QMC02
NOTE: As the receiver channel is still not created and started, … the sender channel will still not be in the running status

START CHANNEL(QMC01.QMC02)

Step8: Display the Channel Status QMC01.QMC02

display chstatus(QMC01.QMC02)

Screenshots for commands

MQcommunication3

 

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

Testing

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

Step1: Ensure that the listeners is started and running on the Dest Qmgr Server QMC02

START LISTENER(QMC02.LISTENER)

Step2: Check the Status of Listeners on Qmgr QMC02

DISPLAY LSSTATUS (QMC02.LISTENER)

Step3: Ensure the Receiver channel is started on the Destination Qmgr Server QMC02

START CHANNEL(QMC01.QMC02)

Step4: Display the Receiver Channel Status on the Destination Qmgr Server QMC02

DISPLAY CHSTATUS(QMC01.QMC02)

Step5: Ensure that the Sender Channel is started and running on the Source Qmgr Server QMC01

START CHANNEL(QMC01.QMC02)

Step6: Display the channel Status QMC01.QMC02 on the Source Qmgr Server QMC01

DISPLAY CHSTATUS(QMC01.QMC02)

Step7: Check the Queue Depth of the Dest Queue ie QL.A

bash-3.2$echo “DISPLAY QLOCAL(QL.A) CURDEPTH ” | runmqsc QMC02 | grep CURDEPTH

MQcommunication4

Step8: Put the message in the Source Qmgr using the “./amqsput [Remote Queue Def]  [Source Qmgr] “ 

bash-3.2$/opt/mqm/samp/bin/amqsput QRMT02 QMC01

MQcommunication5

I put the message “This is a Remote Test” in the Remote Queue Definition  QRMT02 in the source Qmgr QMC01 .

So if the configurations are proper then this message should be received by the Destination Queue QL.A on Qmgr QMC02

So the Message would flow internally from

MQcommunication8

 

Step9: View the Queue Depth of Destination Queue QL.A

bash-3.2$echo “DISPLAY QLOCAL(QL.A) CURDEPTH ” | runmqsc QMC02 | grep CURDEPTH

MQcommunication6

The Message has successfully arrived at the destination Queue ie QL.A

Step10: Browser the messages from the QL.A using “./amqsgbr [Dest Queue]  [Dest Qmgr]” or get the message using “./amqsget [Dest Queue]  [Dest Qmgr]”

bash-3.2$/opt/mqm/samp/bin/amqsgbr QL.A QMC02

Put some messages form the Source Qmgr and see if the messages is recived in the Destination Qmgrs and in Queue specified

 

MQcommunication7

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

Troubleshooting

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

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

Step2: The Sender Channel Name in the Source Qmgr  and the  Receiver Channel Name in the destination Qmgr should have the same Name

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

Step4:  Recheck the configurations done

Step5:  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 *