Strict message ordering with the WebSphere MQ messaging provider and message-driven bean (MDB) applications

Message ordering is important to some asynchronous messaging applications; that is, it is important to process messages in the same order that the producer sends them. If this type of message ordering is important to your application, your design must take it into account.

For example, a messaging application that processes seat reservations might have producer components and a consumer component. A producer component sends a message to the consumer component when a customer reserves a seat. If the customer cancels the reservation then the producer (or possibly a different producer) sends a second message. Typically, the consumer component must process the first message (which reserves the seat) before it processes the second message (which cancels the reservation).

Some applications use a synchronous (request-response) pattern where the producer waits for a response to each message before it sends the next message. In this type of application, the consumer controls the order in which it receives the messages and can ensure that this is the same order as the producer or producers send them. Other applications use an asynchronous (fire and forget) pattern where the producer sends messages without waiting for responses. Even for this type of application, order is usually preserved; that is, a consumer can expect to receive messages in the same order as the producer or producers send them, especially when there is a significant time between sending consecutive messages. However your design must consider factors that can disrupt this order.

The order of messages is disrupted if your application sends messages with different priorities (higher priority messages can overtake lower priority messages) or if your application explicitly receives a message other than the first by specifying message selectors. Parallel processing and error or exception processing can also affect message ordering.

The following topics explain how strict message ordering can be achieved when deploying message-driven bean applications to the WebSphere® MQ messaging provider for WebSphere Application Server when no special facilities have been coded into the application to handle messages arriving out of order:

For WebSphere Application Server Version 7 and later, listener ports are stabilized. For more information, read the article on stabilized features. You should plan to migrate your WebSphere MQ message-driven bean deployment configurations from using listener ports to using activation specifications. However, you should not begin this migration until you are sure the application does not have to work on application servers earlier than WebSphere Application Server Version 7. For example, if you have an application server cluster with some members at Version 6.1 and some at Version 7, you should not migrate applications on that cluster to use activation specifications until after you migrate all the application servers in the cluster to Version 7.




Subtopics
Strict message ordering using non-ASF listener ports
Strict message ordering using activation specifications or ASF listener ports connected to WebSphere MQ Version 7.0
Strict message ordering using activation specifications or ASF listener ports connected to WebSphere MQ Version 6.0
Related concepts
Interoperation using the WebSphere MQ messaging provider
Related reference
Stabilized features
WebSphere MQ library
Concept topic Concept topic    

Terms of Use | Feedback

Last updatedLast updated: Sep 19, 2011 7:16:32 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=matt&product=was-express-iseries&topic=cmm_wmq_smo
File name: cmm_wmq_smo.html