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 Android Security Essentials Live Lessons this week in the Android 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: http://aspose.com/file-tools
subject: Queue up messages based on a field
Similar Threads
putting back into the queue the JMS messages
mdb doesn't catch messages in point2point
Locking on multiple simultaneous inserts
Maintaining single queue for all recievers in jms
Single MDB instane - multiple messages ?