Workload balancing for message driven beans when using WebSphere Application Server clusters

When using message driven bean applications deployed in a WebSphere Application Server Version 7.0 and Version 8.0 cluster, and configured to run in IBM WebSphere MQ messaging provider normal mode, one of the cluster members processes the majority of the messages. We can balance the workload of cluster members in order to distribute the processing of messages across more than one cluster member.

IBM WebSphere MQ Version 7.0 introduced a new feature called Asynchronous consume, which allows applications to consume messages asynchronously from a queue using APIs called MQCB and MQCTL.

Message driven bean applications running inside of WebSphere Application Server Version 7.0 and Version 8.0, that use IBM WebSphere MQ messaging provider normal mode will automatically make use of this feature. When the applications start up, they will set up an asynchronous consumer on the JMS destination that they have been configured to monitor by calling MQCB. The MQCTL API is then called to indicate that the application is ready to receive messages from the JMS destination.

When message driven bean applications have been deployed into a WebSphere Application Server cluster, each cluster member will set up an asynchronous consumer for the JMS destination that the message-driven bean is monitoring for messages. The IBM WebSphere MQ Version 7.0 queue manager that hosts the JMS destination is then responsible for notifying the cluster member when there is a suitable message on the JMS destination for it to process.

Prior to IBM WebSphere MQ Version 7.0.1, Fix Pack 6, queue managers will favor the first cluster member to set up its asynchronous consumer on the JMS Destination. This cluster member will be the first to be notified when a suitable message arrives on the JMS destination. Subsequently, the first cluster member to start the message-driven bean application will process the majority of suitable messages that arrive on the JMS destination.

When WebSphere Application Server is connecting to a IBM WebSphere MQ Version 7.0.1, Fix Pack 6 or later queue manager, messages that arrive on a JMS destination will be distributed more evenly to all of the asynchronous consumers that have been registered on that JMS destination. For message-driven bean applications deployed inside of a WebSphere Application Server Version 7.0 and Version 8.0 cluster, this means that the messages will be distributed more evenly between cluster members.

Parent topic: Use IBM MQ and WebSphere Application Server together


Related information