public class SamplingThrottleMediator extends AbstractMediator implements ManagedLifecycle
This implements the well known Sample
EIP (Enterprise Integration Pattern),
which controls the flow of messages and limit the rate at which the messages are flowing
through the sampler
Please note that the usage of this will require the sampler to be on the out-flow as well to correctly determine & to manage the rate.
AbstractMediator
log, trace, traceState
Constructor and Description |
---|
SamplingThrottleMediator() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
This method should implement the destroying of the
implemented parts of the configuration.
|
String |
getId() |
MessageQueue |
getMessageQueue() |
int |
getSamplingRate() |
Target |
getTarget() |
long |
getUnitTime() |
void |
init(SynapseEnvironment synapseEnvironment)
This method should implement the initialization of the
implemented parts of the configuration.
|
boolean |
isMessageQueueExplicitlySet() |
boolean |
mediate(MessageContext messageContext)
Invokes the mediator passing the current message for mediation.
|
void |
setId(String id) |
void |
setMessageQueue(MessageQueue messageQueue) |
void |
setSamplingRate(int samplingRate) |
void |
setTarget(Target target) |
void |
setUnitTime(long unitTime) |
auditLog, auditWarn, configure, disableStatistics, enableStatistics, getAspectConfiguration, getDescription, getLog, getTraceState, getType, handleException, handleException, isContentAware, isStatisticsEnable, isTraceOn, isTraceOrDebugOn, setDescription, setEffectiveTraceState, setTraceState, shouldTrace, traceOrDebug, traceOrDebugWarn
public void init(SynapseEnvironment synapseEnvironment)
ManagedLifecycle
init
in interface ManagedLifecycle
synapseEnvironment
- SynapseEnvironment to be used for initializationpublic void destroy()
ManagedLifecycle
destroy
in interface ManagedLifecycle
public boolean mediate(MessageContext messageContext)
Mediator
public int getSamplingRate()
public void setSamplingRate(int samplingRate)
public String getId()
public void setId(String id)
public Target getTarget()
public void setTarget(Target target)
public long getUnitTime()
public void setUnitTime(long unitTime)
public MessageQueue getMessageQueue()
public void setMessageQueue(MessageQueue messageQueue)
public boolean isMessageQueueExplicitlySet()
Copyright © 2005-2017 Apache Software Foundation. All Rights Reserved.