(zos)Messaging flow for ASF message-driven beans with WebSphere MQ as the messaging provider
Application Server Facilities (ASF) is used with messaging providers that include the optional ASF extensions to the JMS specification. On z/OS these extensions are implemented by the WebSphere MQ messaging provider. From WAS v7 onwards, JCA is preferred to the older ASF technology.
ASF support for message-driven beans in WebSphere Application Server is known as the message listener service. When you install an ASF message-driven bean application you provide configuration information as a message listener port.
Figure 1. WebSphere MQ connections - Message Listener Service (ASF)
On z/OS, ASF is used with two different messaging flow patterns.
- For all message sources except non-durable subscriptions, the message listener runs in the control region (CR), that is, it is Listening in the controller for these messages.
- For non-durable subscriptions, the message listener runs in the servant regions (SRs), that is, it is Listening in the servant for these messages.
Listening in the controller
The following figure shows WebSphere MQ ASF messaging flow when the message listener is listening in the controller
In the z/OS WebSphere Application Server, ASF supports message-driven processing where the message-driven bean listener is in the CR and the work is distributed to the message-driven bean dispatcher in the SRs. Note that for publish-subscribe there is one listener that registers one subscription for the entire server, not separate subscriptions for each SR.
Figure 2. WebSphere MQ ASF - listening in the controller
Processing is as follows:
- When a message arrives on a JMS destination (shown in the figure as a WebSphere MQ queue), the listener receives a copy of the message. The listener does not delete the message from the destination.
- The listener determines the transaction class for the message and uses z/OS workload management (WLM) to pass a message token (not the actual message) to an SR. Workload management selects an appropriate SR based on the transaction class.
- The dispatcher uses the message token to receive the message and pass it to the onMessage method of the message-driven bean. The dispatcher deletes the message from the destination.
Listening in the servant
The following figure shows WebSphere MQ ASF messaging flow when the message listener is listening in a servant region.
The figure shows a special form of ASF message-driven bean processing where both the message-driven bean listener and the message-driven bean dispatcher run in the same SR. WAS uses this configuration for non-durable publish-subscribe messaging. Each SR registers its own subscription so that one server, potentially, receives and processes multiple copies of the same publication (that is, one copy of the same publication for each SR).
Figure 3. WebSphere MQ ASF - listening in the servant
Processing is as follows:
- When a message arrives at the destination (shown in the figure as a WebSphere MQ queue), the listener receives a copy of the message. The listener does not delete the message from the destination.
- The listener calls code in the CR which uses z/OS WLM to pass a message token back to the same SR.
- The dispatcher uses the message token to receive the message and pass it to the onMessage method of the message-driven bean. The dispatcher deletes the message from the destination.
Subtopics
- (zos) The message-driven bean throttling mechanism on z/OS
On z/OS, message-driven bean throttling mechanisms control the amount of work that the server processes at any given time for a message-driven bean. The throttling mechanism limits how far the listener will read ahead to try to ensure that the work request queue does not have a backlog of messages to be processed.
- (zos) Tune listener ports for workload management on WebSphere Application Server for z/OS
Tune the listener ports to enable effective workload management (WLM) by calculating the optimal value for the Maximum sessions property.
- (zos) MDB throttle settings for message-driven beans on z/OS
We can tune a variety of settings for the "MDB throttle", to control the amount of MDB work that the server processes at a given time.
- (zos) Connection factory settings for ASF message-driven beans that use WebSphere MQ as the messaging provider on z/OS
We can tune a variety of connection factory settings to control the creation of connections and sessions for message-driven bean (MDB) work.
Related concepts
Message processing in ASF mode and non-ASF mode
Related tasks
(zos) Optimizing MDB throttle support for debugging in z/OS