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, setName
public AbortSlowAckConsumerStrategy()
public void setBrokerService(Broker broker)
SlowConsumerStrategy
setBrokerService
in interface SlowConsumerStrategy
setBrokerService
in class AbortSlowConsumerStrategy
broker
- The running Broker.public void slowConsumer(ConnectionContext context, Subscription subs)
SlowConsumerStrategy
slowConsumer
in interface SlowConsumerStrategy
slowConsumer
in class AbortSlowConsumerStrategy
context
- Connection context of the subscription.subs
- The subscription object for the slow consumer.public void run()
run
in interface Runnable
run
in class AbortSlowConsumerStrategy
public void addDestination(Destination destination)
SlowConsumerStrategy
addDestination
in interface SlowConsumerStrategy
addDestination
in class AbortSlowConsumerStrategy
destination
- 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–2024 The Apache Software Foundation. All rights reserved.