Strict message ordering using activation specifications or ASF listener ports connected to WebSphere MQ Version 6.0
Strict message ordering can be achieved when deploying message driven bean applications to the WebSphere MQ messaging provider for when no special facilities have been coded into the application to handle messages arriving out of order.
对于 WebSphere® Application Server V7 和更高版本,已稳定侦听器端口。有关更多信息,请参阅有关固定功能的文章。您应进行规划,以便将 WebSphere MQ 消息驱动的 Bean 部署配置由使用侦听器端口迁移为使用激活规范。有关如何为非 ASF 方式配置激活规范的更多信息,请参阅为非 ASF 方式配置激活规范。但是,仅当您确定此应用程序不必在版本低于 WebSphere Application Server V7 的应用程序服务器上工作时,您才能开始此迁移。例如,如果应用程序服务器集群中某些成员的版本为 V6.1,而某些成员为更高版本,那么仅当您将该集群中的所有应用程序服务器都迁移到此更高版本之后,才能迁移该集群上的应用程序以使用激活规范。
The following assumptions have been made in this scenario:
- 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 6.0.
WebSphere Application Server configuration for ordered delivery
- 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:
- One part 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.
Note: When an ASF listener port or activation specification is connected to a WebSphere MQ Version 6.0 or earlier queue manager, a less efficient polling mechanism (based on a browse cursor) is used to detect messages on the queue.
Circumstances in which messages can arrive out of order
Messages can arrive out of order with this deployment in the following circumstances:
Considerations for a clustered deployment
- You can 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.