How to configure One way Basic Websphere MQ Communication ?

For this setup we are using 2 Servers and 2 Queue Managers:

Server 1 with QM1
Server 2 with QM2

Sender End requirement (Server 1 , QM1):

Remote queue
Transmission queue (best practice: Name it with the destination server queue manager)
Sender Channel (name needs to match receiver channel)

Receiver End requirement (Server 2, QM2):

Listener
Receiver Channel (name needs to match sender channel)
Local queue
Here if you drop a message to the remote queue in server 1, you will receive the message in Local queue in server 2.

Add the MQSC commands given below to a file in Server 2:

Define local queue which will receive the message:

DEFINE QLOCAL (LQ) REPLACE

Define local queue which will receive the message:

DEFINE LISTENER (QM2.LSY) + TRPTYPE (TCP) + CONTROL (QMGR) + PORT (1414) + REPLACE

Start listener:

START LISTENER (QM2.LSY)

Define receiver channel - Note that the channel name needs to match the sender channel:

DEFINE CHANNEL (QM1.QM2) +CHLTYPE (RCVR) + TRPTYPE (TCP) + REPLACE
Start channel:

START CHANNEL(QM1.QM2)

Execute the MQSC script file and redirect the output to a file:

runmqsc QM2 < server1-objects > output.txt

Add the MQSC commands given below to a file in Server 1 (Sender End):
Define local transmission queue - remember match Qlocal name with destination queue manager :

DEFINE QLOCAL (QL) + USAGE (XMITQ) +REPLACE

Define local reference of remote queue - provide details of target QM and queue:

DEFINE QREMOTE (RQ) +RNAME (LQ) + RQMNAME ('QM2’) + XMITQ (QL) +REPLACE

Define sending channel - Two key things to remember, provide listener details of target queue manager and the channel name here should match target queue manager

DEFINE CHANNEL (QM1.QM2) + CHLTYPE (SDR) + CONNAME ('Server2 hostname or IP(1414)') +XMITQ (QL) + TRPTYPE (TCP) + REPLACE *

Start Channel defined above:

START CHANNEL (QM1.QM2)

Execute the MQSC script file and redirect the output to a file:

runmqsc QM1 < server2-objects > output.txt

Now you should be able to communicate between the 2 queue managers i.e. send messages from server 1, QM1 to server 2, QM2.

Comments