[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: new QueueBrowser implementation

ataylor do-not-reply at jboss.com
Fri Oct 10 10:11:03 EDT 2008


anonymous wrote : In most cases, refs are only ever removed from the head of the queue, so you can just go back to the beginning of the queue. That's the 99% case and is pretty trivial. 

If you've iterated over 5 messages and then one is removed you don't go back to the beginning, you go to 4 which is the last message you looked at.

Also, if messages are being added/removed all the time, then the iterator would fail pretty much every time with a concurrentModificationException.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4181514#4181514

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



More information about the jboss-dev-forums mailing list