Search in sources :

Example 16 with ErrorHandlerBuilderRef

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

the class ContextScopedOnExceptionRouteScopedErrorHandlerRefIssueTest method createRouteBuilder.

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

        @Override
        public void configure() throws Exception {
            onException(IllegalArgumentException.class).handled(true).to("mock:handled").end();
            from("direct:start").errorHandler(new ErrorHandlerBuilderRef("myDLC")).to("mock:a").throwException(new IllegalArgumentException("Damn"));
        }
    };
}
Also used : RouteBuilder(org.apache.camel.builder.RouteBuilder) ErrorHandlerBuilderRef(org.apache.camel.builder.ErrorHandlerBuilderRef)

Example 17 with ErrorHandlerBuilderRef

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

the class ContextScopedOnExceptionErrorHandlerRefIssueTest method createRouteBuilder.

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

        @Override
        public void configure() throws Exception {
            errorHandler(new ErrorHandlerBuilderRef("myDLC"));
            onException(IllegalArgumentException.class).handled(true).to("mock:handled").end();
            from("direct:start").to("mock:a").throwException(new IllegalArgumentException("Damn"));
        }
    };
}
Also used : RouteBuilder(org.apache.camel.builder.RouteBuilder) ErrorHandlerBuilderRef(org.apache.camel.builder.ErrorHandlerBuilderRef)

Aggregations

ErrorHandlerBuilderRef (org.apache.camel.builder.ErrorHandlerBuilderRef)17 RouteBuilder (org.apache.camel.builder.RouteBuilder)13 IOException (java.io.IOException)4 LinkedHashMap (java.util.LinkedHashMap)1 Map (java.util.Map)1 XmlAttribute (javax.xml.bind.annotation.XmlAttribute)1 ErrorHandlerFactory (org.apache.camel.ErrorHandlerFactory)1 ErrorHandlerBuilder (org.apache.camel.builder.ErrorHandlerBuilder)1