use of org.apache.camel.processor.RedeliveryErrorHandler 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);
}
}
}
use of org.apache.camel.processor.RedeliveryErrorHandler in project camel by apache.
the class ManagedErrorHandler method setLogHandled.
public void setLogHandled(Boolean log) {
if (!isSupportRedelivery()) {
throw new IllegalArgumentException("This error handler does not support redelivery");
}
RedeliveryErrorHandler redelivery = (RedeliveryErrorHandler) errorHandler;
redelivery.getRedeliveryPolicy().setLogHandled(log);
}
use of org.apache.camel.processor.RedeliveryErrorHandler in project camel by apache.
the class ManagedErrorHandler method setUseExponentialBackOff.
public void setUseExponentialBackOff(Boolean backoff) {
if (!isSupportRedelivery()) {
throw new IllegalArgumentException("This error handler does not support redelivery");
}
RedeliveryErrorHandler redelivery = (RedeliveryErrorHandler) errorHandler;
redelivery.getRedeliveryPolicy().setUseExponentialBackOff(backoff);
}
use of org.apache.camel.processor.RedeliveryErrorHandler in project camel by apache.
the class ManagedErrorHandler method setMaximumRedeliveries.
public void setMaximumRedeliveries(Integer maximum) {
if (!isSupportRedelivery()) {
throw new IllegalArgumentException("This error handler does not support redelivery");
}
RedeliveryErrorHandler redelivery = (RedeliveryErrorHandler) errorHandler;
redelivery.getRedeliveryPolicy().setMaximumRedeliveries(maximum);
}
use of org.apache.camel.processor.RedeliveryErrorHandler in project camel by apache.
the class ManagedErrorHandler method setLogStackTrace.
public void setLogStackTrace(Boolean log) {
if (!isSupportRedelivery()) {
throw new IllegalArgumentException("This error handler does not support redelivery");
}
RedeliveryErrorHandler redelivery = (RedeliveryErrorHandler) errorHandler;
redelivery.getRedeliveryPolicy().setLogStackTrace(log);
}
Aggregations