@Override
public Processor createProcessor(RouteContext routeContext) throws Exception {
Processor childProcessor = this.createChildProcessor(routeContext, true);
if (messageFrequency != null) {
return new SamplingThrottler(childProcessor, messageFrequency);
} else {
// should default be 1 sample period
long time = getSamplePeriod() != null ? getSamplePeriod() : 1L;
// should default be in seconds
TimeUnit tu = getUnits() != null ? getUnits() : TimeUnit.SECONDS;
return new SamplingThrottler(childProcessor, time, tu);
}
}