@Override public Optional<ProcessorDefinition> handle(Throttle step, ProcessorDefinition route, SyndesisRouteBuilder routeBuilder) { ThrottleDefinition throttle = route.throttle(step.getMaximumRequests()); Long period = step.getPeriodMillis(); if (period != null) { throttle.timePeriodMillis(period); } return routeBuilder.addSteps(throttle, step.getSteps()); } }
@Override public void configure() throws Exception { from("seda:orders").id("legacyRoute") .throttle(5).timePeriodMillis(10000).asyncDelayed().id("orderThrottler") .to("seda:legacy"); } }
private void addThrottling(TryDefinition route) { Throttling throttling = _reference.getServiceMetadata().getThrottling(); long timePeriodMS = throttling != null ? throttling.getTimePeriod() : Throttling.DEFAULT_TIME_PERIOD; route.filter(THROTTLE_CHECK) .throttle(header(Throttling.MAX_REQUESTS)).timePeriodMillis(timePeriodMS) // throttle needs a child process, so we'll just remove the header // using an empty process definition causes some of the interceptors // to blow chunks, specifically audit interceptors .removeHeader(Throttling.MAX_REQUESTS) .end().end(); } }
private void addThrottling(TryDefinition route) { Throttling throttling = _reference.getServiceMetadata().getThrottling(); long timePeriodMS = throttling != null ? throttling.getTimePeriod() : Throttling.DEFAULT_TIME_PERIOD; route.filter(THROTTLE_CHECK) .throttle(header(Throttling.MAX_REQUESTS)).timePeriodMillis(timePeriodMS) // throttle needs a child process, so we'll just remove the header // using an empty process definition causes some of the interceptors // to blow chunks, specifically audit interceptors .removeHeader(Throttling.MAX_REQUESTS) .end().end(); } }
Long period = step.getPeriodMillis(); if (period != null) { throttle.timePeriodMillis(period);
.process(smppAddressing) .throttle(throttleRequestsPerPeriod) .timePeriodMillis(throttleTimePeriodMillis) .to(smppUriProducer)