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 Spring in Action this week in the Spring 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
Author

Queue up messages based on a field

Hansel Tizer
Greenhorn

Joined: Jan 13, 2009
Posts: 2
Hi,

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.

Thanks.
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Sounds like you want a Map<ID, Queue>.
 
 
subject: Queue up messages based on a field