One way of implementing this is having a set of BlockingQueues one for each "id"
value.
Then you have a pool of workers that poll on these queues.
This is basically how a ThreadPoolExecutor works, but instead of a single queue feeding
it, you have many queues.
I'd take a look at what Trustin has done in
org.apache.mina.filter.executor.OrderedThreadPoolExecutor (which works similarly to how
I've described)
You want to avoid having one thread per id value since you may have many thousands of id
values.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4140651#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...