How to Setup IBM MQ Gateway QMGR

A queue manager on which the interface queues are not located, but on which they are defined as cluster queues. Such a queue manager is called a gateway queue manager.

Sample Diagram for Gate Way QMGR

Created 3 QMGRS in TEST cluster

dis clusqmgr(*)
     2 : dis clusqmgr(*)
AMQ8441I: Display Cluster Queue Manager details.
   CLUSQMGR(FR1)                           CHANNEL(TO.FR1)
   CLUSTER(TEST)                        
AMQ8441I: Display Cluster Queue Manager details.
   CLUSQMGR(FR2)                           CHANNEL(TO.FR2)
   CLUSTER(TEST)                        
AMQ8441I: Display Cluster Queue Manager details.
   CLUSQMGR(GWQM)                          CHANNEL(TO.GWQM)
   CLUSTER(TEST)                        

Here FR1 and FR2 actually hold the interface queue .Ex QL1
Application connecting to GRQM doenst hold the actual Queue but puts a message into an interface queue because the queue is not managed by GWQM .GWQM checks its cluster queue defninitions.It recognizes that QL1 is managed by FR1,Fr2 so GWQM puts the message to QL1 on one of the QMGR’s (FR1,FR2). subsequent messages will be load balenced to FR1 and FR2

define ql(QL1) cluster(Test) defbind(notfixed)
Defined QL1 on Both FR1 and FR2

Sending 10 messages to QL1 using GWQM

bash-4.4$ cat put.sh 
 #!/bin/bash
 for i in `seq 10` ; do
  echo "Sending $i message"
  echo "Test MSG $i" |/opt/mqm/samp/bin/amqsput QL1 GWQM >/dev/null 2>&1
 done 
bash-4.4$

Verify the messages on FR1 QL1

bash-4.4$ /opt/mqm/samp/bin/amqsget QL1 FR1
Sample AMQSGET0 start
message <Test MSG 2>
message <Test MSG 4>
message <Test MSG 6>
message <Test MSG 8>
message <Test MSG 10>
no more messages
Sample AMQSGET0 end
bash-4.4$ 

Verify the messages on FR2 QL1

bash-4.4$ /opt/mqm/samp/bin/amqsget QL1 FR2
Sample AMQSGET0 start
message <Test MSG 1>
message <Test MSG 3>
message <Test MSG 5>
message <Test MSG 7>
message <Test MSG 9>
no more messages
Sample AMQSGET0 end
bash-4.4$ 

Messages can also be routed to a gateway queue manager from queue managers that are external to the cluster. Refer below Diagram .

Application have its own QMGR (non-cluster) and it connects to GWQM . If the Application side has another MQ cluster then GWQM will be used to OverLap two cluster’s

Related Posts

Leave a Reply

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