public class AbortSlowAckConsumerStrategy extends AbortSlowConsumerStrategy
broker, name, scheduler, slowConsumers, taskStarted| Constructor and Description |
|---|
AbortSlowAckConsumerStrategy() |
| Modifier and Type | Method and Description |
|---|---|
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).
|
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 |
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.
|
abortConsumer, abortSubscription, getCheckPeriod, getMaxSlowCount, getMaxSlowDuration, getName, getSlowConsumers, isAbortConnection, isIgnoreNetworkSubscriptions, setAbortConnection, setCheckPeriod, setIgnoreNetworkConsumers, setMaxSlowCount, setMaxSlowDuration, setNamepublic AbortSlowAckConsumerStrategy()
public void setBrokerService(Broker broker)
SlowConsumerStrategysetBrokerService in interface SlowConsumerStrategysetBrokerService in class AbortSlowConsumerStrategybroker - The running Broker.public void slowConsumer(ConnectionContext context, Subscription subs)
SlowConsumerStrategyslowConsumer 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)
SlowConsumerStrategyaddDestination 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.Copyright © 2005–2020 The Apache Software Foundation. All rights reserved.