Ive implemented a message expirer that basically iterates through each queue and expires
any messages. The problem is that because I've used the iterator, which is fail fast,
the method has to be synchronized on queue which is, as Tim correctly pointed out, not
very scalable.
An alternative would be be to use the getAll() method on the PriorityLinkedList, which
basically makes a copy, and iterate through this. We would then only need to synchronize
on removing any expired messages. If the message has been consumed since checking then we
just ignore as the client will take care of expiring it.
Another alternative would be to maintain another concurrentset of the messages and iterate
over these instead.
thoughts?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4192143#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...