How messages are processed in ASF mode

In ASF mode, server sessions and threads are only allocated for work when a message that is suitable for the message-driven bean (MDB) is detected. The number of threads that an MDB can process concurrently is determined by the value of the Maximum Sessions property for the listener port.

对于 WebSphere® Application Server V7 和更高版本,已稳定侦听器端口。有关更多信息,请参阅有关固定功能的文章。您应进行规划,以便将 WebSphere MQ 消息驱动的 Bean 部署配置由使用侦听器端口迁移为使用激活规范。[AIX Solaris HP-UX Linux Windows][IBM i]有关如何为非 ASF 方式配置激活规范的更多信息,请参阅为非 ASF 方式配置激活规范但是,仅当您确定此应用程序不必在版本低于 WebSphere Application Server V7 的应用程序服务器上工作时,您才能开始此迁移。例如,如果应用程序服务器集群中某些成员的版本为 V6.1,而某些成员为更高版本,那么仅当您将该集群中的所有应用程序服务器都迁移到此更高版本之后,才能迁移该集群上的应用程序以使用激活规范。

[AIX Solaris HP-UX Linux Windows][IBM i]
The following diagram shows how messaging takes place between WebSphere Application Server and IBM MQ when the message listener service is operating in ASF mode.
Figure 1. Message processing in ASF mode on distributed and IBM i systems
The figure is described in the surrounding text.
As shown in the diagram, when the message listener service is operating in ASF mode, messages are processed in the following way:
  1. When the listener port is started, it opens a connection to the IBM MQ queue manager and creates an internal queue agent.
  2. The queue agent listens to the JMS destination for messages.
  3. The queue agent detects a message.
  4. The queue agent checks whether the message is suitable for the MDB that is using the listener port.
  5. If the message is suitable for the MDB, the listener port allocates a thread from the message listener service thread pool, and allocates a server session from the application server's server session pool. If this is the first time the server session has been used since the listener port has been started, it opens a connection to the JMS provider. The allocated server session runs on the allocated thread.
  6. The queue agent passes the ID of the message to the server session. It then starts listening for messages again.
  7. The server session uses the message ID to retrieve the message from the destination.
  8. The server session processes the message by calling the onMessage() method of the MDB.
  9. When the message has been processed, the server session exits and returns to the application server session pool. The connection that the server session opened to the JMS provider remains open so that the server session does not need to re-establish the connection the next time it is used.
  10. The thread exits and returns to the message listener service thread pool.

The number of threads that an MDB can process concurrently is determined by the value of the Maximum Sessions property for the listener port. If you set Maximum Sessions to the default value of 1, this means that the MDB can only process one message at a time. Therefore, if the queue agent finds a second message before the first message has finished being processed, the queue agent blocks the second message until processing of the first message is complete and the server session has become available.

If you want to process more than one message concurrently, you can do this in ASF mode by setting Maximum Sessions to a value higher than 1. For example, if you set Maximum Sessions to 2, messages are processed in the following way:
  1. The queue agent detects the first message and allocates a thread and a server session as in the first example. The message is processed using the onMessage() method of the MDB.
  2. Whilst the first message is processing, the queue agent starts listening for messages again.
  3. The queue agent detects the second message and allocates a second thread and a second server session. The message is processed using the onMessage() method of the MDB.
  4. When the first message is processed, the first server session exits and returns to the server session pool. The first thread exits and returns to the thread pool.
  5. When the second message is processed, the second server session exits and returns to the server session pool. The second thread exits and returns to the thread pool.
[z/OS]

The following diagram shows how messaging takes place between WebSphere Application Server and IBM MQ when the message listener service is operating in ASF mode.

Figure 2. Message processing in ASF mode on z/OS systems
The figure is described in the surrounding text.
As shown in the diagram, when the message listener service is operating in ASF mode, messages are processed in the following way:
  1. When the listener port is started, it opens a connection to the IBM MQ queue manager and creates an internal queue agent.
  2. The queue agent listens to the JMS destination for messages.
  3. The queue agent detects a message and checks whether it is suitable for the MDB that is using the listener port.
  4. If the message is suitable for the MDB, the queue agent passes the message ID into a work record. The work record is then sent to the workload management (WLM) queue.
  5. The queue agent starts listening for messages again.
  6. The WLM queue starts an ASF dispatcher inside a servant region to process the work record.
  7. The ASF dispatcher allocates a server session from the server session pool.
  8. The server session use the message ID from the work record to retrieve the message from the destination.
  9. The server session processes the message by calling the onMessage() method of the MDB.
  10. When the message is processed, the server session exits and returns to the application server session pool. The connection that the server session has opened to the JMS provider remains open so that the server session does not need to re-establish the connection the next time it is used.
  11. The thread exits and returns to the message listener service thread pool.

The number of threads that an MDB can process concurrently is determined by the value of the Maximum Sessions property for the listener port. If you set Maximum Sessions to the default value of 1, this means that the MDB can only process one message at a time. Therefore, if the queue agent finds a second message before the first message has finished being processed, the queue agent blocks the second message until processing of the first message is complete and the server session has become available.

If you want to process more than one message concurrently, you can do this in ASF mode by setting Maximum Sessions to a value higher than 1. For example, if you set Maximum Sessions to 2, messages are processed in the following way:
  1. The queue agent detects the first message and sets up a work record, as in the first example.
  2. The work record is sent to the WLM queue and an ASF dispatcher is set up in a servant region.
  3. The ASF dispatcher allocates a server session and the message is processed using the onMessage() method of the MDB.
  4. Whilst the first message is processing, the queue agent starts listening for messages again.
  5. The queue agent detects the second message and allocates a second thread and a second server session. The message is processed using the onMessage() method of the MDB.
  6. When the first message is processed, the first server session exits and returns to the server session pool. The first thread exits and returns to the thread pool.
  7. When the second message is processed, the second server session exits and returns to the server session pool. The second thread exits and returns to the thread pool.

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



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