When a message-driven bean is mapped (that is, listening to) a
queue, or to a topic through a durable subscription, a JMS message first enters
into the WebSphere server in the controller, so we say the server is "listening
in the controller" for these messages. When a message arrives, it flows
through a sequence of events.
When a message has arrived on a JMS destination (queue or topic) on which
a message-driven bean running is listening, the following sequence of events
takes place:
- The WebSphere MQ JMS queue agent thread (running in the controller) browses
the JMS destination. The queue agent identifies the application server on
which a message-driven bean is running for that destination. The queue agent
calls a Message Reference Handler (MRH) registered by the application server,
to tell the server that a message has arrived on a destination on which one
of its message-driven beans is listening. A message reference corresponding
to this message is sent along with the call to the MRH.
- If the throttle high threshold value (see below) has not been exceeded,
a work request corresponding to the just-browsed message is queued onto the
WLM queue in the controller.
- The work request is dispatched to an individual servant. A ServerSession
is obtained from the appropriate ServerSessionPool in that servant and, using
the message reference as index, the message is destructively consumed from
the JMS destination.
- The MDB application onMessage(Message) method is dispatched with the consumed
message.
- When the onMessage(Message) method finishes, the servant notifies the
controller that the work record has completed.