public class AbortSlowConsumerStrategy extends Object implements SlowConsumerStrategy, Runnable
Constructor and Description |
---|
AbortSlowConsumerStrategy() |
Modifier and Type | Method and Description |
---|---|
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) |
public void setBrokerService(Broker broker)
setBrokerService
in interface SlowConsumerStrategy
public void slowConsumer(ConnectionContext context, Subscription subs)
slowConsumer
in interface SlowConsumerStrategy
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()
Copyright © 2005–2017 The Apache Software Foundation. All rights reserved.