Class SamplingThrottleMediator
- java.lang.Object
-
- org.apache.synapse.mediators.AbstractMediator
-
- org.apache.synapse.mediators.eip.sample.SamplingThrottleMediator
-
- All Implemented Interfaces:
AspectConfigurable
,ManagedLifecycle
,Mediator
,SynapseArtifact
public class SamplingThrottleMediator extends AbstractMediator implements ManagedLifecycle
This implements the well knownSample
EIP (Enterprise Integration Pattern), which controls the flow of messages and limit the rate at which the messages are flowing through the samplerPlease 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.
- See Also:
AbstractMediator
-
-
Field Summary
-
Fields inherited from class org.apache.synapse.mediators.AbstractMediator
log, trace, traceState
-
-
Constructor Summary
Constructors Constructor Description SamplingThrottleMediator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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)
-
Methods inherited from class org.apache.synapse.mediators.AbstractMediator
auditLog, auditWarn, configure, disableStatistics, disableTracing, divertMediationRoute, enableStatistics, enableTracing, getAspectConfiguration, getCommentsList, getDescription, getInputType, getLastSequenceFaultHandler, getLog, getMediatorName, getMediatorPosition, getOutputType, getRegisteredMediationFlowPoint, getShortDescription, getTraceState, getType, handleException, handleException, isBreakPoint, isContentAltering, isContentAware, isSkipEnabled, isStatisticsEnable, isTraceOn, isTraceOrDebugOn, isTracingEnabled, registerMediationFlowPoint, reportCloseStatistics, reportOpenStatistics, setBreakPoint, setCommentsList, setComponentStatisticsId, setDescription, setEffectiveTraceState, setMediatorPosition, setShortDescription, setSkipEnabled, setTraceState, shouldCaptureTracing, shouldTrace, shouldTrace, traceOrDebug, traceOrDebugWarn, unregisterMediationFlowPoint
-
-
-
-
Method Detail
-
init
public void init(SynapseEnvironment synapseEnvironment)
Description copied from interface:ManagedLifecycle
This method should implement the initialization of the implemented parts of the configuration.- Specified by:
init
in interfaceManagedLifecycle
- Parameters:
synapseEnvironment
- SynapseEnvironment to be used for initialization
-
destroy
public void destroy()
Description copied from interface:ManagedLifecycle
This method should implement the destroying of the implemented parts of the configuration.- Specified by:
destroy
in interfaceManagedLifecycle
-
mediate
public boolean mediate(MessageContext messageContext)
Description copied from interface:Mediator
Invokes the mediator passing the current message for mediation. Each mediator performs its mediation action, and returns true if mediation should continue, or false if further mediation should be aborted.
-
getSamplingRate
public int getSamplingRate()
-
setSamplingRate
public void setSamplingRate(int samplingRate)
-
getId
public String getId()
-
setId
public void setId(String id)
-
getTarget
public Target getTarget()
-
setTarget
public void setTarget(Target target)
-
getUnitTime
public long getUnitTime()
-
setUnitTime
public void setUnitTime(long unitTime)
-
getMessageQueue
public MessageQueue getMessageQueue()
-
setMessageQueue
public void setMessageQueue(MessageQueue messageQueue)
-
isMessageQueueExplicitlySet
public boolean isMessageQueueExplicitlySet()
-
-