org.jboss.messaging.core.server.impl
Class GroupingRoundRobinDistributor

java.lang.Object
  extended by org.jboss.messaging.core.server.impl.DistributorImpl
      extended by org.jboss.messaging.core.server.impl.RoundRobinDistributor
          extended by org.jboss.messaging.core.server.impl.GroupingRoundRobinDistributor
All Implemented Interfaces:
Distributor

public class GroupingRoundRobinDistributor
extends RoundRobinDistributor

Distributes message based on the message property 'JBM_GROUP_ID'. Once a message has been successfully delivered to a consumer that consumer is then bound to that group. Any message that has the same group id set will always be delivered to the same consumer. The Initial consumer is the first consumer found, using the round robin policy, that hasn't been bound to a group, If there are no consumers left that have not been bound to a group then the next consumer will be bound to 2 groups and so on.

Author:
Andy Taylor, Tim Fox

Field Summary
 
Fields inherited from class org.jboss.messaging.core.server.impl.RoundRobinDistributor
pos
 
Fields inherited from class org.jboss.messaging.core.server.impl.DistributorImpl
consumers
 
Constructor Summary
GroupingRoundRobinDistributor()
           
 
Method Summary
 HandleStatus distribute(MessageReference reference)
           
 boolean removeConsumer(Consumer consumer)
           
 
Methods inherited from class org.jboss.messaging.core.server.impl.RoundRobinDistributor
addConsumer, getConsumerCount, handle, incrementPosition
 
Methods inherited from class org.jboss.messaging.core.server.impl.DistributorImpl
getConsumers, hasConsumers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupingRoundRobinDistributor

public GroupingRoundRobinDistributor()
Method Detail

distribute

public HandleStatus distribute(MessageReference reference)
Specified by:
distribute in interface Distributor
Overrides:
distribute in class RoundRobinDistributor

removeConsumer

public boolean removeConsumer(Consumer consumer)
Specified by:
removeConsumer in interface Distributor
Overrides:
removeConsumer in class RoundRobinDistributor


Copyright © 2006 JBoss Inc. All Rights Reserved.