Configure request/reply from a cluster

Configure a request/reply message path from a cluster to a queue manager outside the cluster. Hide the details of how a queue manager inside the cluster communicates outside the cluster by using a gateway queue manager.


Before starting

Figure 1 shows a queue manager, QM2, inside the cluster DEMO. It sends a request to a queue, Q3, hosted on queue manager outside the cluster. The replies are returned to Q2 at QM2 inside the cluster.

To communicate with the queue manager outside the cluster, one or more queue managers inside the cluster act as a gateway. A gateway queue manager has a communication path to the queue managers outside the cluster. In the example, QM1 is the gateway.

Figure 1. Putting to a queue manager outside the cluster


Follow the instructions to set up the path for the request and reply messages


Procedure

  1. Send the request message from the cluster.

    Consider how the queue manager, QM2, which is inside the cluster puts a message to the queue Q3 at QM3, which is outside the cluster.

    1. Create a QREMOTE definition on QM1 that advertises the remote queue Q3 to the cluster
      DEFINE QREMOTE(Q3) RNAME(Q3) RQMNAME(QM3) CLUSTER(DEMO)
      

    It also has a sender-channel and a transmission queue to the queue manager that is outside the cluster. QM3 has a corresponding receiver-channel. The channels are not shown in Figure 1.

    An application on QM2 issues an MQPUT call specifying the target queue and the queue to which replies are to be sent. The target queue is Q3 and the reply-to queue is Q2.

    The message is sent to QM1, which uses its remote-queue definition to resolve the queue name to Q3 at QM3.

  2. Receive the reply message from the queue manager outside the cluster.

    A queue manager outside the cluster must have a queue manager alias for each queue manager in the cluster to which it send a message. The queue manager alias must also specify the name of the transmission queue to the gateway queue manager. In this example, QM3 needs a queue manager alias definition for QM2:

    1. Create a queue manager alias QM2 on QM3
      DEFINE QREMOTE(QM2) RNAME(' ') RQMNAME(QM2) XMITQ(QM1)
      

    QM3 also needs a sender-channel and transmission queue to QM1 and QM1 needs a corresponding receiver-channel.

    The application, app3, on QM3 can then send replies to QM2, by issuing an MQPUT call and specifying the queue name, Q2 and the queue manager name, QM2.


What to do next

We can define more than one route out of a cluster.

Parent topic: Routing messages to and from clusters


Related concepts


Related tasks