[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Server-side browser refactoring

jmesnil do-not-reply at jboss.com
Fri Jun 19 08:57:33 EDT 2009


I'm working on https://jira.jboss.org/jira/browse/JBMESSAGING-1437 to have the browser
iterates on the queue rather than working on a snapshot copy of the queue.

First steps was to use LinkedBlockingDeque to provide an iterator on PriorityLinkedList which allows for
concurrent traversals and mutations

Next step is to refactor the server-side to have the browser works on the iterator

How does a browser differ from a simple consumer?
2/ the queue will deliver all messages to the browser but never removed the corresponding references
3/ the queue must not deliver messages to the browser through its distribution policy

Delivering messages to browsers and to regular consumers are two different code paths that can
not occur in the same loop

When a consumer is added to the queue, the queue could check if it is a browser or not.
If it is a browser, it is *not* added to the Distributor.
  
For now there is a single DeliverRunner for the queue (-> regular code path)
We could add other Runnable for every browser with their own iterators.
When the session is prompted to deliver, we must check if the consumer prompting for delivery is
a browser or not.
if it is a browser, a Runnable will be created with its own iterator and executed.  It will deliver all ref to the browser *without removing the ref from the iterator*
if it is not a browser, regular code path applies

When a consumer is removed, we check if there is a Runnable associated to it and stop it if necessary
wdyt?


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

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



More information about the jboss-dev-forums mailing list