Search in sources :

Example 6 with ThrottlingExceptionRoutePolicy

use of org.apache.camel.impl.ThrottlingExceptionRoutePolicy in project camel by apache.

the class ManagedThrottlingExceptionRoutePolicyTest method createRouteBuilder.

@Override
protected RouteBuilder createRouteBuilder() throws Exception {
    ThrottlingExceptionRoutePolicy policy = new ThrottlingExceptionRoutePolicy(10, 1000, 5000, null);
    policy.setHalfOpenHandler(new DummyHandler());
    return new RouteBuilder() {

        @Override
        public void configure() throws Exception {
            from("direct:start").routeId("testRoute").routePolicy(policy).to("log:foo").process(new BoomProcess()).to("mock:result");
        }
    };
}
Also used : RouteBuilder(org.apache.camel.builder.RouteBuilder) ThrottlingExceptionRoutePolicy(org.apache.camel.impl.ThrottlingExceptionRoutePolicy)

Aggregations

ThrottlingExceptionRoutePolicy (org.apache.camel.impl.ThrottlingExceptionRoutePolicy)6 RouteBuilder (org.apache.camel.builder.RouteBuilder)5 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)4 Channel (org.apache.camel.Channel)1 Consumer (org.apache.camel.Consumer)1 NonManagedService (org.apache.camel.NonManagedService)1 Processor (org.apache.camel.Processor)1 Producer (org.apache.camel.Producer)1 RuntimeCamelCatalog (org.apache.camel.catalog.RuntimeCamelCatalog)1 ConsumerCache (org.apache.camel.impl.ConsumerCache)1 DefaultEndpointRegistry (org.apache.camel.impl.DefaultEndpointRegistry)1 DefaultTransformerRegistry (org.apache.camel.impl.DefaultTransformerRegistry)1 DefaultValidatorRegistry (org.apache.camel.impl.DefaultValidatorRegistry)1 ProducerCache (org.apache.camel.impl.ProducerCache)1 ThrottlingInflightRoutePolicy (org.apache.camel.impl.ThrottlingInflightRoutePolicy)1 ManagedAsyncProcessorAwaitManager (org.apache.camel.management.mbean.ManagedAsyncProcessorAwaitManager)1 ManagedBacklogDebugger (org.apache.camel.management.mbean.ManagedBacklogDebugger)1 ManagedBacklogTracer (org.apache.camel.management.mbean.ManagedBacklogTracer)1 ManagedConsumerCache (org.apache.camel.management.mbean.ManagedConsumerCache)1 ManagedEndpointRegistry (org.apache.camel.management.mbean.ManagedEndpointRegistry)1