Examples of adviceWith()


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

*/
public class AdviceWithPolicyTest extends ContextTestSupport {

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

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

*/
public class AdviceWithOnExceptionTest extends ContextTestSupport {

    public void testAdviceWithOnException() throws Exception {
        RouteDefinition route = context.getRouteDefinitions().get(0);
        route.adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                weaveById("b").after().to("mock:result");
            }
        });
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 ErrorHandlerAdviceIssueTest extends ContextTestSupport {

    public void testErrorHandlerAdvice() throws Exception {
        RouteDefinition foo = context.getRouteDefinition("foo");
        foo.adviceWith(context, new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("seda:*")
                        .skipSendToOriginalEndpoint()
                        .throwException(new IllegalAccessException("Forced"));
View Full Code Here

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

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

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

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

public class HttpInterceptSendToEndpointTest extends CamelTestSupport {

    @Test
    public void testHttpInterceptSendToEndpoint() throws Exception {
        RouteDefinition route = context.getRouteDefinitions().get(0);
        route.adviceWith(context, new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("http*").to("mock:http").skipSendToOriginalEndpoint();
            }
        });
View Full Code Here

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

*/
public class RouteScopedOnExceptionWithInterceptSendToEndpointIssueTest extends ContextTestSupport {

    public void testIssue() 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()

        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 PropertiesComponentAdviceWithInterceptSendToEndpointTest extends ContextTestSupport {

    public void testAdviceWithInterceptSendToEndpoint() throws Exception {
        RouteDefinition route = context.getRouteDefinition("foo");
        route.adviceWith(context, new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("{{cool.mock}}:res*").to("mock:foo");
            }
        });
View Full Code Here

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

*/
public class InterceptSendToEndpointWithParametersTest extends ContextTestSupport {

    public void testInterceptSendToEndpoint() throws Exception {
        RouteDefinition route = context.getRouteDefinitions().get(0);
        route.adviceWith(context, new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("log*").to("mock:http").skipSendToOriginalEndpoint();
            }
        });
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.