The Cluster Queue Monitoring sample program (AMQSCLM)
This sample uses the built-in IBM® MQ cluster workload balancing features to direct messages to instances of queues that have consuming applications attached. This automatic direction prevents the build-up of messages on an instance of a cluster queue to which no consuming application is attached.
You can set up a cluster that has more than one definition for the same queue on different queue managers. This configuration provides the benefit of increased availability and workload balancing. However, there is no capability built into IBM MQ to dynamically modify the distribution of messages across a cluster based on the state of attached applications. For this reason, a consuming application must always be attached to every instance of a queue to ensure that messages are processed.
The cluster queue monitoring sample program monitors the state of attached applications. The program dynamically adjusts the built-in workload balancing configuration to direct messages to instances of a clustered queue with consuming applications attached. In certain situations this program can be used to relax the need for a consuming application to always be connected to every instance of a queue. It also resends messages that become queued on an instance of a queue with no consuming applications attached. Resending messages enables messages to be routed around a consuming application that is temporarily shut down.
The program is designed to be used where the consuming applications are long running applications, rather than frequently attaching and detaching applications.
The cluster queue monitoring sample program is the compiled executable program of the C sample file amqsclma.c.
Further information about clusters and workload can be found in Using clusters for workload management