wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes Doubt in Ordering of JMS queue messages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Doubt in Ordering of JMS queue messages" Watch "Doubt in Ordering of JMS queue messages" New topic
Author

Doubt in Ordering of JMS queue messages

B.Sathish
Ranch Hand

Joined: Aug 18, 2005
Posts: 372
The Head First EJB book MDB chapter says that queues are not ordered. The ordering of messages is not guaranteed and we should not program depending on an order. The JMS book by RMH says that queue messages will be ordered and will be delivered to the receivers in the same order in which they were delivered to the queue by the message server. So which is right? Are queue messages ordered or unordered? Are they guaranteed to be delivered to the receiver in the same order in which they were sent by the sender? What happens if there are multiple receivers? Will that affect the ordering? Please clarify.
Chris Brat
Ranch Hand

Joined: May 22, 2003
Posts: 108
As far as I know you cannot code according to the order of messages because if one message fails (transaction rolled back) then it is placed at the back of the queue behind any messages that were posted before it.


SCJP 1.2, SCJP 5, SCBCD
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


Are queue messages ordered or unordered?

There is nothing the the J2EE spec. to require JMS providers to maintian message queue order, so always assume they are unordered.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
Consider Paul's rocket mass heater.
 
subject: Doubt in Ordering of JMS queue messages