aspose file tools*
The moose likes Threads and Synchronization and the fly likes Queue up messages based on a field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Queue up messages based on a field" Watch "Queue up messages based on a field" New topic

Queue up messages based on a field

Hansel Tizer

Joined: Jan 13, 2009
Posts: 2

I have a number of threads delivering messages to my app.

Each message is basically an Object with an id.

I need to create a single queue for messages related to that id.
i.e. each queue will only contain Objects with the same ID.

Any advice/code samples appreciated.

Jeff Verdegan

Joined: Jan 03, 2004
Posts: 6109

Sounds like you want a Map<ID, Queue>.
I agree. Here's the link:
subject: Queue up messages based on a field
Similar Threads
Locking on multiple simultaneous inserts
Single MDB instane - multiple messages ?
putting back into the queue the JMS messages
Maintaining single queue for all recievers in jms
mdb doesn't catch messages in point2point