Using a gateway queue manager for workload balancing

Figure 1 shows a configuration in which, to improve availability, a single service runs in two separate servers, and a gateway queue manager is used to balance the workload.

Figure 1. A single service running in two servers
Figure showing a single service running in two servers
This configuration uses three queue managers that are members of a single queue manager cluster:
GQM
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.
QM1 and QM2
The queue managers on which the interface queues are located. Each of these queue managers is associated with a different message broker, and each message broker runs a copy of the same service (in this example, SERVICE5). Each set of interface queues is associated with an input queue, and it is from this input queue that a copy of SERVICE5 retrieves the requests it is to process.

The application, which is connected to GQM, puts a message into an interface queue. Because the queue is not managed by GQM, GQM checks its cluster queue definitions. It recognizes that the queue is managed by both QM1 and QM2, so the GQM puts the message in the interface queue of one of these two queue managers. When relaying messages, it alternates between QM1 and QM2, thereby balancing the workload between the two copies of SERVICE5.

Messages can also be routed to a gateway queue manager from queue managers that are external to the cluster. For more information about this and other aspects of IBM® MQ clustering, refer to IBM MQ: Queue Manager Clusters.