Search in sources :

Example 1 with ErrorHandlerSupport

use of org.apache.camel.processor.ErrorHandlerSupport in project camel by apache.

the class ErrorHandlerBuilderSupport method configure.

public void configure(RouteContext routeContext, ErrorHandler handler) {
    if (handler instanceof ErrorHandlerSupport) {
        ErrorHandlerSupport handlerSupport = (ErrorHandlerSupport) handler;
        List<OnExceptionDefinition> list = onExceptions.get(routeContext);
        if (list != null) {
            for (OnExceptionDefinition exception : list) {
                handlerSupport.addExceptionPolicy(routeContext, exception);
            }
        }
    }
    if (handler instanceof RedeliveryErrorHandler) {
        boolean original = ((RedeliveryErrorHandler) handler).isUseOriginalMessagePolicy();
        if (original) {
            // ensure allow original is turned on
            routeContext.setAllowUseOriginalMessage(true);
        }
    }
}
Also used : RedeliveryErrorHandler(org.apache.camel.processor.RedeliveryErrorHandler) ErrorHandlerSupport(org.apache.camel.processor.ErrorHandlerSupport) OnExceptionDefinition(org.apache.camel.model.OnExceptionDefinition)

Aggregations

OnExceptionDefinition (org.apache.camel.model.OnExceptionDefinition)1 ErrorHandlerSupport (org.apache.camel.processor.ErrorHandlerSupport)1 RedeliveryErrorHandler (org.apache.camel.processor.RedeliveryErrorHandler)1