org.apache.camel.processor
Class SamplingThrottler
java.lang.Object
org.apache.camel.impl.ServiceSupport
org.apache.camel.processor.DelegateProcessor
org.apache.camel.processor.SamplingThrottler
- All Implemented Interfaces:
- Navigate<Processor>, Processor, Service
public class SamplingThrottler
- extends DelegateProcessor
A 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.
- Version:
- $Revision: 885283 $
|
Field Summary |
protected org.apache.commons.logging.Log |
log
|
| Methods inherited from class org.apache.camel.impl.ServiceSupport |
addChildService, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, removeChildService, start, stop |
log
protected final transient org.apache.commons.logging.Log log
SamplingThrottler
public SamplingThrottler(Processor processor,
long samplePeriod,
TimeUnit units)
toString
public String toString()
- Overrides:
toString in class DelegateProcessor
getTraceLabel
public String getTraceLabel()
process
public void process(Exchange exchange)
throws Exception
- Description copied from interface:
Processor
- Processes the message exchange
- Specified by:
process in interface Processor- Overrides:
process in class DelegateProcessor
- Parameters:
exchange - the message exchange
- Throws:
Exception - if an internal processing error has occurred.
Copyright © 2007-2010 The Apache Software Foundation. All Rights Reserved.