Expression maxRequestsExpression = createMaxRequestsPerPeriodExpression(routeContext);
if (maxRequestsExpression == null) {
throw new IllegalArgumentException("MaxRequestsPerPeriod expression must be provided on " + this);
}
Throttler answer = new Throttler(routeContext.getCamelContext(), childProcessor, maxRequestsExpression, period, threadPool, shutdownThreadPool);
if (getAsyncDelayed() != null) {
answer.setAsyncDelayed(getAsyncDelayed());
}
if (getCallerRunsWhenRejected() == null) {
// should be true by default
answer.setCallerRunsWhenRejected(true);
} else {
answer.setCallerRunsWhenRejected(getCallerRunsWhenRejected());
}
return answer;
}