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

timfox do-not-reply at jboss.com
Fri Oct 17 04:39:13 EDT 2008


"ataylor" wrote : anonymous wrote : 1) Why are the methods stop, start, restart, and the extra logic around "messagesWaiting", and the extra server consumer start and stop necessary in the ClientBrowserImpl? 
  | 
  | This to stop delivery of messages and wait for any in transit messages are received before restarting with a new iterator. 
  | 

Why do you need to do that?

anonymous wrote : 
  | messagesWaiting is so we can figure out if any messages are left to browse.
  | 

Can't you use the current receiveImmediate() method to do that?

anonymous wrote : 
  | anonymous wrote : A simpler solution would have been to take the copied Set of refs from the queue.list() method, and then instantiate a QueueImpl instance on the fly and just have the consumer consume from that, or create a simple class that just iterates the set and get it to call the handle() method of ServerConsumer, then you wouldn't need to duplicate the code.
  | 
  | Ok, I can do it this way if you prefer.

Well, I hope you agree it's simpler and avoids code duplication too ;)

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

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



More information about the jboss-dev-forums mailing list