|
||||||||||
| 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
org.apache.activemq.broker.region.policy.AbortSlowAckConsumerStrategy
public class AbortSlowAckConsumerStrategy
Abort slow consumers when they reach the configured threshold of slowness, default is that a consumer that has not Ack'd a message for 30 seconds is slow.
| Field Summary |
|---|
| Fields inherited from class org.apache.activemq.broker.region.policy.AbortSlowConsumerStrategy |
|---|
broker, name, scheduler, slowConsumers, taskStarted |
| Constructor Summary | |
|---|---|
AbortSlowAckConsumerStrategy()
|
|
| Method Summary | |
|---|---|
void |
addDestination(Destination destination)
For Strategies that need to examine assigned destination for slow consumers periodically the destination is assigned here. |
long |
getMaxTimeSinceLastAck()
Gets the maximum time since last Ack before a subscription is considered to be slow. |
boolean |
isIgnoreIdleConsumers()
Returns whether the strategy is configured to ignore consumers that are simply idle, i.e consumers that have no pending acks (dispatch queue is empty). |
boolean |
isIgnoreNetworkSubscriptions()
Returns whether the strategy is configured to ignore subscriptions that are from a network connection. |
void |
run()
|
void |
setBrokerService(Broker broker)
Sets the Broker instance which can provide a Scheduler among other things. |
void |
setIgnoreIdleConsumers(boolean ignoreIdleConsumers)
Sets whether the strategy is configured to ignore consumers that are simply idle, i.e consumers that have no pending acks (dispatch queue is empty). |
void |
setIgnoreNetworkConsumers(boolean ignoreNetworkConsumers)
Sets whether the strategy is configured to ignore consumers that are part of a network connection to another broker. |
void |
setMaxTimeSinceLastAck(long maxTimeSinceLastAck)
Sets the maximum time since last Ack before a subscription is considered to be slow. |
void |
slowConsumer(ConnectionContext context,
Subscription subs)
Slow consumer event. |
| Methods inherited from class org.apache.activemq.broker.region.policy.AbortSlowConsumerStrategy |
|---|
abortConsumer, abortSubscription, getCheckPeriod, getMaxSlowCount, getMaxSlowDuration, getName, getSlowConsumers, isAbortConnection, setAbortConnection, setCheckPeriod, setMaxSlowCount, setMaxSlowDuration, setName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbortSlowAckConsumerStrategy()
| Method Detail |
|---|
public void setBrokerService(Broker broker)
SlowConsumerStrategy
setBrokerService in interface SlowConsumerStrategysetBrokerService in class AbortSlowConsumerStrategybroker - The running Broker.
public void slowConsumer(ConnectionContext context,
Subscription subs)
SlowConsumerStrategy
slowConsumer in interface SlowConsumerStrategyslowConsumer in class AbortSlowConsumerStrategycontext - Connection context of the subscription.subs - The subscription object for the slow consumer.public void run()
run in interface Runnablerun in class AbortSlowConsumerStrategypublic void addDestination(Destination destination)
SlowConsumerStrategy
addDestination in interface SlowConsumerStrategyaddDestination in class AbortSlowConsumerStrategydestination - A destination to add to a watch list.public long getMaxTimeSinceLastAck()
public void setMaxTimeSinceLastAck(long maxTimeSinceLastAck)
maxTimeSinceLastAck - the maximum time since last Ack (mills) before the consumer is considered to be slow.public boolean isIgnoreIdleConsumers()
public void setIgnoreIdleConsumers(boolean ignoreIdleConsumers)
ignoreIdleConsumers - Should this strategy ignore idle consumers or consider all consumers when checking
the last ack time verses the maxTimeSinceLastAck value.public boolean isIgnoreNetworkSubscriptions()
public void setIgnoreNetworkConsumers(boolean ignoreNetworkConsumers)
ignoreNetworkConsumers - Should this strategy ignore subscriptions made by a network connector.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||