Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes EJB and other Java EE Technologies and the fly likes Order of messages with multiple mdb's Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Order of messages with multiple mdb Watch "Order of messages with multiple mdb New topic

Order of messages with multiple mdb's

Amey Sane

Joined: Feb 09, 2009
Posts: 1

Well, I have this kind of trivial problem for me.
I have a JMS queue, where I have some message objects stored.
Multiple MDB instaces can listen to this queue at runtime.
Now, each of this MDB instance picks up an object from the queue, as and when it arrives.
Then, it performs some operations on this object (which is not all that important in this context).
After this, that MDB instance places the object it has processed in another queue.
However, I am not understanding, how do i maintain the order of objects in another queue.
I mean, the order in which objects were picked up from the first queue and the order in which they are placed in another queue after processing, should be same.
Any suggestions?
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 31680

What are you trying to accomplish that you need the messages in a certain order? Would putting a sequence number in the message help? More information will help people here give a more useful answer.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
RaviNada Kiran
Ranch Hand

Joined: Jan 30, 2009
Posts: 528
You cannot Guarantee the order ,if you use pool of MDBs.

If you want the order use only single MDB.

If you want something you never had do something which you had never done
It is sorta covered in the JavaRanch Style Guide.
subject: Order of messages with multiple mdb's