@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
@Override
public void configure() throws Exception {
ThrottlingInflightRoutePolicy policy = new ThrottlingInflightRoutePolicy();
policy.setMaxInflightExchanges(10);
policy.setResumePercentOfMax(50);
policy.setScope(ThrottlingInflightRoutePolicy.ThrottlingScope.Route);
from("activemq:queue:foo?concurrentConsumers=20").routePolicy(policy)
.delay(100)
.to("log:foo?groupSize=10").to("mock:result");
}