How to Control the Message Order for Message Driven Beans in WebSphere Application Server 5.0.x
 Technote (troubleshooting)
 
Problem(Abstract)
How can the message order be guaranteed to a Message Driven Bean (MDB)?
 
Resolving the problem
To ensure that a given MDBListener processes messages in order, the ListenerPort maxSessions property must be set to 1. This means that only one MDB ServerSession and thus only one MDB instance will process messages on that Server. MDBListeners are per Server, and thus if a given MDB is deployed across a given cell, then an MDBListener
will be created on each Server, all consuming from the same destination.
Logically, to guarantee the message order there must be a single consumer thread. If there is more than one ServerSession or more than one MDBListener, these independent threads can not be controlled. So defining one MDBListener on a single Server with ListenerPort settings of maxSessions = 1 and maxMessages = 1 will ensure that the message processing order is correct.

Note: The maxMessages should always be set to 1 for WebSphere MQ JMS because of the transactional behavior of WebSphere MQ. The maxMessages property controls the batching of messages passed to the MDB ServerSession.
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Java Message Service (JMS)
Operating system(s): Windows
Software version: 5.0
Software edition:
Reference #: 1107950
IBM Group: Software Group
Modified date: Apr 16, 2003