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.

对于 WebSphere® Application Server V7 和更高版本,已稳定侦听器端口。有关更多信息,请参阅有关固定功能的文章。您应进行规划,以便将 WebSphere MQ 消息驱动的 Bean 部署配置由使用侦听器端口迁移为使用激活规范。[AIX Solaris HP-UX Linux Windows][IBM i]有关如何为非 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 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:

  • 在回滚事务之后,在重新传送已回滚的消息之前,可能会传送队列中的下一个可用消息:
    • 对于 ASF 侦听器端口,如果将最大重试次数设置为 0,那么在进行回滚时将停止该侦听器端口,从而会阻止在回滚后进行无序传送。但然后必须手动重新启动该侦听器端口。
    • 对于激活规范,如果选择在消息传送失败时停止端点并将暂挂端点之前的连续传送失败次数设置为 0,那么在进行回滚时将暂停消息端点,从而会阻止在回滚后进行无序传送。但然后必须手动恢复 MDB 的消息端点。有关更多信息,请参阅 WebSphere MQ 信息中心。
  • 在事务恢复期间,可能会不按顺序传送消息:
    Note: 必须按特定顺序发生一组特定事件才能遇到这种情况,这是很少见的。然而,如果有序消息传送对于应用程序的运行很重要,那么您必须考虑这种情况。
    • 在从下列其中一个组件的故障中进行恢复期间,使用此部署选项可能会发生无序消息传送:
      • 主管 MDB 的应用程序服务器
      • WebSphere MQ 队列管理器
      • 连接应用程序服务器和队列管理器的网络
    • 如果其中一个组件在 MDB 事务的两阶段落实期间发生故障,那么应用程序服务器事务管理器将重新建立与队列管理器的连接,以在该组件再次可用时落实该事务。
    • 此恢复过程是一个异步过程,因此有可能在完成事务恢复过程之前就会开始将新消息传送到 MDB。如果事务恢复的结果是要回滚事务,那么该消息将返回到 WebSphere MQ 队列并重新传送到应用程序,此过程有可能在已传送新消息之后进行。

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.

指示主题类型的图标 概念主题



时间戳记图标 最近一次更新时间: July 9, 2016 9:27
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=cmm_wmq_smo_mq7
文件名:cmm_wmq_smo_mq7.html