In a MQ cluster using workload balancing, if one of the Queue Manager's Queue is full, how can the messages get automatically rerouted to the other Queue Manager's instance of the queue?
Answer by David Ware (191) | May 01, 2015 at 10:03 AM
In fact MQ provides a sample very close to this called amqsclm. The sample monitors for queues where no application is attached to get the messages and then modifies the CLWLPRTY to achieve what Erick says. The source code for the sample is provided so a change to monitor for queue depth rather than attached getter should be simple. See here for more information.
http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.dev.doc/q024620_.htm?lang=en
Answer by ErickC (844) | Apr 24, 2015 at 06:49 PM
If one of the instance gets full then you can make the queue as PUT(DISABLED) so that the cluster workload management algorithm will not consider it at all while choosing the best alternative. This means you would need a script which monitors whether MAXDEPTH=CURDPETH or reaching near and then flip the PUT parameter. Much of the sophistication can be added using queue depth events (QDEPTHHI, QDEPTHLO, etc). For more details on queue depth events, refer to the following documentation:
http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.mon.doc/q036420_.htm?lang=en
Once the CURDPETH reduces to an acceptable value PUT can be enabled again to drive the workload sharing.