Strict message ordering using activation specifications or ASF listener ports connected to WebSphere MQ Version 7.x
Strict message ordering can be achieved when deploying message driven bean applications to the WebSphere® MQ messaging provider when no special facilities have been coded into the application to handle messages arriving out of order.
For WebSphere Application Server Version 7 and later, listener ports are stabilized. For more information, read the topic about stabilized features. Plan to migrate your WebSphere MQ message-driven bean deployment configurations from using listener ports to using activation specifications. However, you should not begin this migration until you are sure the application does not have to work on application servers earlier than WebSphere Application Server Version 7. For example, if you have an application server cluster with some members at Version 6.1 and some at a later version, you should not migrate applications on that cluster to use activation specifications until after you migrate all the application servers in the cluster to the later version.
- The message-driven bean (MDB) application is transactional.
- The back-out threshold (BOTHRESH) on the WebSphere MQ queue has been set to 0.
- You are using WebSphere MQ Version 7.0 or later.
WebSphere Application Server configuration for ordered delivery
- The WebSphere MQ queue manager must be running on WebSphere MQ Version 7.0 or later.
- The connection to the queue manager must use the WebSphere MQ messaging provider normal mode. See the Rules for selecting the WebSphere MQ messaging provider mode topic of the WebSphere MQ information center.
- If you are using listener ports Maximum sessions on the listener ports in WebSphere Application Server must be set to 1.
- If you are using activation specifications Maximum server sessions on the activation specifications in WebSphere Application Server must be set to 1.
Important information about this configuration
- ASF listener ports and WebSphere MQ activation
specifications contain two separate parts, which together perform
message delivery. These two parts are seen as separate applications
by the queue manager:
- Part one detects messages as they arrive, but does not consume them. Instead it dispatches them to the second part.
- Part two is a server session pool which allocates a thread to process the message within the application's transaction, and deliver it to the onMessage() method of the MDB.
- From Version 7.0, WebSphere MQ provides a push model for detection of the messages, which is more efficient than the polling model used in previous versions of WebSphere MQ, and provides better ordering of message under normal operation.
Circumstances in which messages can be delivered out of order
Messages can be delivered out of order with this configuration in the following circumstances:
Considerations for a clustered deployment
- You must activate the MDB on one cluster member only, as the application server does not have a facility which can manage this activation automatically.
- You can set the startup state of listener ports to stopped, separately to setting the startup state of an application.
- You can manually start and stop applications, ASF listener ports, and message endpoints with MBean interfaces by using wsadmin scripting, or by using the com.ibm.websphere.management.AdminClient interfaces from Java™ code.