Search in sources :

Example 1 with NoErrorHandlerBuilder

use of org.apache.camel.builder.NoErrorHandlerBuilder in project camel by apache.

the class CxfRsSpringConsumerTest method createRouteBuilder.

protected RouteBuilder createRouteBuilder() throws Exception {
    final Processor testProcessor = new Processor() {

        public void process(Exchange exchange) throws Exception {
            // just throw the CustomException here
            throw new CustomException("Here is the exception");
        }
    };
    final Processor responseProcessor = new Processor() {

        public void process(Exchange exchange) throws Exception {
            // do something else with the request properties as usual
            // do something else with the response
            exchange.getOut().getBody(Customer.class).setId(246);
        }
    };
    return new RouteBuilder() {

        public void configure() {
            errorHandler(new NoErrorHandlerBuilder());
            from("cxfrs://bean://rsServer").process(testProcessor);
            from("cxfrs://bean://rsServer2").process(testProcessor);
            from("cxfrs://bean://rsServerInvoke?performInvocation=true").process(responseProcessor);
        }
    };
}
Also used : Exchange(org.apache.camel.Exchange) Processor(org.apache.camel.Processor) RouteBuilder(org.apache.camel.builder.RouteBuilder) Customer(org.apache.camel.component.cxf.jaxrs.testbean.Customer) NoErrorHandlerBuilder(org.apache.camel.builder.NoErrorHandlerBuilder) CustomException(org.apache.camel.component.cxf.jaxrs.testbean.CustomException)

Example 2 with NoErrorHandlerBuilder

use of org.apache.camel.builder.NoErrorHandlerBuilder in project camel by apache.

the class CxfRsConsumerTest method createRouteBuilder.

protected RouteBuilder createRouteBuilder() throws Exception {
    final Processor testProcessor = new TestProcessor();
    final Processor testProcessor2 = new TestProcessor2();
    final Processor testProcessor3 = new TestProcessor3();
    return new RouteBuilder() {

        public void configure() {
            errorHandler(new NoErrorHandlerBuilder());
            from(CXF_RS_ENDPOINT_URI).process(testProcessor);
            from(CXF_RS_ENDPOINT_URI2).process(testProcessor);
            from(CXF_RS_ENDPOINT_URI3).process(testProcessor);
            from(CXF_RS_ENDPOINT_URI4).process(testProcessor2);
            from(CXF_RS_ENDPOINT_URI5).process(testProcessor3);
        }
    };
}
Also used : Processor(org.apache.camel.Processor) RouteBuilder(org.apache.camel.builder.RouteBuilder) NoErrorHandlerBuilder(org.apache.camel.builder.NoErrorHandlerBuilder)

Example 3 with NoErrorHandlerBuilder

use of org.apache.camel.builder.NoErrorHandlerBuilder in project camel by apache.

the class CxfGreeterCXFMessageRouterTest method createRouteBuilder.

@Override
protected RouteBuilder createRouteBuilder() {
    return new RouteBuilder() {

        public void configure() {
            context.setErrorHandlerBuilder(new NoErrorHandlerBuilder());
            from("cxf:bean:routerEndpoint?dataFormat=CXF_MESSAGE&publishedEndpointUrl=http://www.simple.com/services/test").to("cxf:bean:serviceEndpoint?dataFormat=CXF_MESSAGE");
        }
    };
}
Also used : RouteBuilder(org.apache.camel.builder.RouteBuilder) NoErrorHandlerBuilder(org.apache.camel.builder.NoErrorHandlerBuilder)

Aggregations

NoErrorHandlerBuilder (org.apache.camel.builder.NoErrorHandlerBuilder)3 RouteBuilder (org.apache.camel.builder.RouteBuilder)3 Processor (org.apache.camel.Processor)2 Exchange (org.apache.camel.Exchange)1 CustomException (org.apache.camel.component.cxf.jaxrs.testbean.CustomException)1 Customer (org.apache.camel.component.cxf.jaxrs.testbean.Customer)1