Configuring workload balancing from outside a cluster

Configure a message path from a queue manager outside a cluster to any copy of a cluster queue. The result is to workload balance requests from outside the cluster to each instance of a cluster queue.

Before you begin

Configure the example, as shown in Figure 1 in Configuring request/reply to a cluster.

About this task

In this scenario, the queue manager outside the cluster, QM3 in Figure 1, sends requests to the queue Q2. Q2 is hosted on two queue managers within cluster DEMO to use workload balancing. A queue named Q2 is defined on the queue managers QM2 and QM4 but not on the gateway queue manager QM1. The requests from QM3, the queue manager outside the cluster, are sent to either instance of Q2.

QM3 is not part of a cluster and communicates using distributed queuing techniques. It must have a sender-channel and a transmission queue to QM1. QM1 needs a corresponding receiver-channel. The channels and transmission queues are not shown explicitly in Figure 1.

The procedure extends the example in Figure 1 in Configuring request/reply to a cluster.

Procedure

  1. Define a local queue called Q2 on each of QM2 and QM4.
    DEFINE QLOCAL(Q2) CLUSTER(DEMO) DEFBIND(NOTFIXED)
    
  2. Create a QREMOTE definition for Q2 on QM3.
    DEFINE QREMOTE(Q2) RNAME(Q2) RQMNAME(Q3) XMITQ(QM1)
    
    Create a QREMOTE definition for each queue in the cluster that QM3 puts messages to.
  3. Create a queue-manager alias Q3 on QM3.
    DEFINE QREMOTE(Q3) RNAME(' ') RQMNAME(' ') CLUSTER(DEMO) DEFBIND(NOTFIXED)
    
    Q3 is not a real queue manager name. It is the name of a queue manager alias definition in the cluster that equates the queue manager alias name Q3 with blank, ' '
  4. QM1, the gateway queue manager, has no special definitions.

Results

Figure 1. Putting from a queue manager outside the cluster
This diagram shows three connected queue managers inside a cluster, QM1, QM2, and QM4. QM1 is connected to a queue manager outside of the cluster, QM3. QM2 and QM4 each have a queue, Q2, and a remote queue, Q3.

When an application at QM3 issues an MQPUT call to put a message to Q2, the QREMOTE definition causes the message to be routed through the gateway queue manager QM1. QM1 uses workload balancing to distribute messages targeted to Q2 between the queues called Q2 on the two queue managers, QM2 and QM4, which have cluster queue manager aliases for Q3.