• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in Ordering of JMS queue messages

 
B.Sathish
Ranch Hand
Posts: 372
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic