Examples of adviceWith()


Examples of org.apache.camel.model.RouteDefinition.adviceWith()

*/
public class StopRouteImpactsErrorHandlerTest extends ContextTestSupport {

    public void testIssue() throws Exception {
        RouteDefinition testRoute = context.getRouteDefinition("TestRoute");
        testRoute.adviceWith(context, new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("seda:*")
                    .skipSendToOriginalEndpoint()
                    .to("log:seda")
View Full Code Here

Examples of org.apache.camel.model.RouteDefinition.adviceWith()

                    .throwException(new IllegalArgumentException("Forced"));
            }
        });

        RouteDefinition smtpRoute = context.getRouteDefinition("smtpRoute");
        smtpRoute.adviceWith(context, new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("smtp*")
                    .to("log:smtp")
                    .skipSendToOriginalEndpoint()
View Full Code Here

Examples of org.apache.camel.model.RouteDefinition.adviceWith()

        final Predicate fail = PredicateBuilder.or(
            header(Exchange.REDELIVERY_COUNTER).isNull(),
            header(Exchange.REDELIVERY_COUNTER).isLessThan(5));

        RouteDefinition route = context.getRouteDefinitions().get(0);
        route.adviceWith(context, new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("seda:*")
                    .skipSendToOriginalEndpoint()
                    .process(new Processor() {
View Full Code Here

Examples of org.apache.camel.model.RouteDefinition.adviceWith()

*/
public class RouteScopedErrorHandlerAndOnExceptionTest extends ContextTestSupport {

    public void testOnException() throws Exception {
        RouteDefinition route = context.getRouteDefinitions().get(0);
        route.adviceWith(context, new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("seda:*")
                    .skipSendToOriginalEndpoint()
                    .throwException(new ConnectException("Forced"));
View Full Code Here

Examples of org.apache.camel.model.RouteDefinition.adviceWith()

        assertMockEndpointsSatisfied();
    }

    public void testErrorHandler() throws Exception {
        RouteDefinition route = context.getRouteDefinitions().get(0);
        route.adviceWith(context, new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("seda:*")
                    .skipSendToOriginalEndpoint()
                    .throwException(new FileNotFoundException("Forced"));
View Full Code Here

Examples of org.apache.camel.model.RouteDefinition.adviceWith()

        final Predicate fail = PredicateBuilder.or(
            header(Exchange.REDELIVERY_COUNTER).isNull(),
            header(Exchange.REDELIVERY_COUNTER).isLessThan(5));

        RouteDefinition route = context.getRouteDefinitions().get(0);
        route.adviceWith(context, new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("seda:*")
                    .skipSendToOriginalEndpoint()
                    .process(new Processor() {
View Full Code Here

Examples of org.apache.camel.model.RouteDefinition.adviceWith()

    }

    public void testAdviceWithErrorHandler() throws Exception {
        RouteDefinition route = context.getRouteDefinitions().get(0);
        try {
            route.adviceWith(context, new AdviceWithRouteBuilder() {
                @Override
                public void configure() throws Exception {
                    errorHandler(deadLetterChannel("mock:dead"));
                }
            });
View Full Code Here

Examples of org.apache.camel.model.RouteDefinition.adviceWith()

        }
    }

    public void testAdviceWithOnException() throws Exception {
        RouteDefinition route = context.getRouteDefinitions().get(0);
        route.adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                onException(IllegalArgumentException.class)
                        .handled(true)
                        .to("mock:error");
View Full Code Here

Examples of org.apache.camel.model.RouteDefinition.adviceWith()

        assertMockEndpointsSatisfied();
    }

    public void testAdviceWithInterceptFrom() throws Exception {
        RouteDefinition route = context.getRouteDefinitions().get(0);
        route.adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptFrom().to("mock:from");
            }
        });
View Full Code Here

Examples of org.apache.camel.model.RouteDefinition.adviceWith()

        assertMockEndpointsSatisfied();
    }

    public void testAdviceWithInterceptSendToEndpoint() throws Exception {
        RouteDefinition route = context.getRouteDefinitions().get(0);
        route.adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("mock:result").to("mock:to");
            }
        });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.