public class SamplingThrottler
extends org.apache.camel.support.AsyncProcessorSupport
implements org.apache.camel.Traceable, org.apache.camel.spi.IdAware
SamplingThrottler
is a special kind of throttler. It also
limits the number of exchanges sent to a downstream endpoint. It differs from
a normal throttler in that it will not queue exchanges above the threshold
for a given period. Instead these exchanges will be stopped, precluding them
from being processed at all by downstream consumers.
This kind of throttling can be useful for taking a sample from
an exchange stream, rough consolidation of noisy and bursty exchange traffic
or where queuing of throttled exchanges is undesirable.Constructor and Description |
---|
SamplingThrottler(long messageFrequency) |
SamplingThrottler(long samplePeriod,
TimeUnit units) |
Modifier and Type | Method and Description |
---|---|
String |
getId() |
long |
getMessageFrequency() |
long |
getSamplePeriod() |
String |
getTraceLabel() |
TimeUnit |
getUnits() |
boolean |
process(org.apache.camel.Exchange exchange,
org.apache.camel.AsyncCallback callback) |
void |
setId(String id) |
String |
toString() |
doStart, doStop, process, processAsync
doInit, doResume, doShutdown, doSuspend, getStatus, init, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
public SamplingThrottler(long messageFrequency)
public SamplingThrottler(long samplePeriod, TimeUnit units)
public String getId()
getId
in interface org.apache.camel.spi.HasId
public void setId(String id)
setId
in interface org.apache.camel.spi.IdAware
public String getTraceLabel()
getTraceLabel
in interface org.apache.camel.Traceable
public long getMessageFrequency()
public long getSamplePeriod()
public TimeUnit getUnits()
public boolean process(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback)
process
in interface org.apache.camel.AsyncProcessor
Apache Camel