org.apache.activemq.broker.region.policy
Class AbortSlowConsumerStrategy

java.lang.Object
  extended by org.apache.activemq.broker.region.policy.AbortSlowConsumerStrategy
All Implemented Interfaces:
Runnable, SlowConsumerStrategy

public class AbortSlowConsumerStrategy
extends Object
implements SlowConsumerStrategy, Runnable

Abort slow consumers when they reach the configured threshold of slowness, default is slow for 30 seconds


Constructor Summary
AbortSlowConsumerStrategy()
           
 
Method Summary
 void abortConsumer(Subscription sub, boolean abortSubscriberConnection)
           
 long getCheckPeriod()
           
 long getMaxSlowCount()
           
 long getMaxSlowDuration()
           
 String getName()
           
 Map<Subscription,SlowConsumerEntry> getSlowConsumers()
           
 boolean isAbortConnection()
           
 void run()
           
 void setAbortConnection(boolean abortConnection)
          abort the consumers connection rather than sending a stop command to the remote consumer
 void setBrokerService(Broker broker)
           
 void setCheckPeriod(long checkPeriod)
          time in milliseconds between checks for slow subscriptions
 void setMaxSlowCount(long maxSlowCount)
          number of times a subscription can be deemed slow before triggering abort effect depends on dispatch rate as slow determination is done on dispatch
 void setMaxSlowDuration(long maxSlowDuration)
          time in milliseconds that a sub can remain slow before triggering an abort.
 void setName(String name)
           
 void slowConsumer(ConnectionContext context, Subscription subs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbortSlowConsumerStrategy

public AbortSlowConsumerStrategy()
Method Detail

setBrokerService

public void setBrokerService(Broker broker)
Specified by:
setBrokerService in interface SlowConsumerStrategy

slowConsumer

public void slowConsumer(ConnectionContext context,
                         Subscription subs)
Specified by:
slowConsumer in interface SlowConsumerStrategy

run

public void run()
Specified by:
run in interface Runnable

abortConsumer

public void abortConsumer(Subscription sub,
                          boolean abortSubscriberConnection)

getMaxSlowCount

public long getMaxSlowCount()

setMaxSlowCount

public void setMaxSlowCount(long maxSlowCount)
number of times a subscription can be deemed slow before triggering abort effect depends on dispatch rate as slow determination is done on dispatch


getMaxSlowDuration

public long getMaxSlowDuration()

setMaxSlowDuration

public void setMaxSlowDuration(long maxSlowDuration)
time in milliseconds that a sub can remain slow before triggering an abort.

Parameters:
maxSlowDuration -

getCheckPeriod

public long getCheckPeriod()

setCheckPeriod

public void setCheckPeriod(long checkPeriod)
time in milliseconds between checks for slow subscriptions

Parameters:
checkPeriod -

isAbortConnection

public boolean isAbortConnection()

setAbortConnection

public void setAbortConnection(boolean abortConnection)
abort the consumers connection rather than sending a stop command to the remote consumer

Parameters:
abortConnection -

setName

public void setName(String name)

getName

public String getName()

getSlowConsumers

public Map<Subscription,SlowConsumerEntry> getSlowConsumers()


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.