[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - message expiry

ataylor do-not-reply at jboss.com
Tue Nov 25 09:54:20 EST 2008


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#4192143

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4192143



More information about the jboss-dev-forums mailing list