|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.activemq.broker.region.policy.AbortSlowConsumerStrategy
public class AbortSlowConsumerStrategy
Abort slow consumers when they reach the configured threshold of slowness, default is slow for 30 seconds
| Field Summary | |
|---|---|
protected Broker |
broker
|
protected String |
name
|
protected Scheduler |
scheduler
|
protected Map<Subscription,SlowConsumerEntry> |
slowConsumers
|
protected AtomicBoolean |
taskStarted
|
| Constructor Summary | |
|---|---|
AbortSlowConsumerStrategy()
|
|
| Method Summary | |
|---|---|
void |
abortConsumer(Subscription sub,
boolean abortSubscriberConnection)
|
protected void |
abortSubscription(Map<Subscription,SlowConsumerEntry> toAbort,
boolean abortSubscriberConnection)
|
void |
addDestination(Destination destination)
For Strategies that need to examine assigned destination for slow consumers periodically the destination is assigned here. |
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)
Sets the Broker instance which can provide a Scheduler among other things. |
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)
Slow consumer event. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String name
protected Scheduler scheduler
protected Broker broker
protected final AtomicBoolean taskStarted
protected final Map<Subscription,SlowConsumerEntry> slowConsumers
| Constructor Detail |
|---|
public AbortSlowConsumerStrategy()
| Method Detail |
|---|
public void setBrokerService(Broker broker)
SlowConsumerStrategy
setBrokerService in interface SlowConsumerStrategybroker - The running Broker.
public void slowConsumer(ConnectionContext context,
Subscription subs)
SlowConsumerStrategy
slowConsumer in interface SlowConsumerStrategycontext - Connection context of the subscription.subs - The subscription object for the slow consumer.public void run()
run in interface Runnable
protected void abortSubscription(Map<Subscription,SlowConsumerEntry> toAbort,
boolean abortSubscriberConnection)
public void abortConsumer(Subscription sub,
boolean abortSubscriberConnection)
public long getMaxSlowCount()
public void setMaxSlowCount(long maxSlowCount)
public long getMaxSlowDuration()
public void setMaxSlowDuration(long maxSlowDuration)
maxSlowDuration - public long getCheckPeriod()
public void setCheckPeriod(long checkPeriod)
checkPeriod - public boolean isAbortConnection()
public void setAbortConnection(boolean abortConnection)
abortConnection - public void setName(String name)
public String getName()
public Map<Subscription,SlowConsumerEntry> getSlowConsumers()
public void addDestination(Destination destination)
SlowConsumerStrategy
addDestination in interface SlowConsumerStrategydestination - A destination to add to a watch list.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||