public class BridgeExceptionHandlerToErrorHandler extends Object implements org.apache.camel.spi.ExceptionHandler
ExceptionHandler
that uses the DefaultConsumer
to process the caused exception to send the message
into the Camel routing engine which allows to let the routing engine handle the exception.
An endpoint can be configured with bridgeErrorHandler=true in the URI to enable this
BridgeExceptionHandlerToErrorHandler
on the consumer. The consumer must extend the DefaultConsumer
,
to support this, if not an IllegalArgumentException
is thrown upon startup.
Notice: When using this bridging error handler, then interceptors, onCompletions does not apply. The
Exchange
is processed directly by the Camel error handler, and does not allow prior actions such as
interceptors, onCompletion to take action.Constructor and Description |
---|
BridgeExceptionHandlerToErrorHandler(DefaultConsumer consumer) |
Modifier and Type | Method and Description |
---|---|
void |
handleException(String message,
org.apache.camel.Exchange exchange,
Throwable exception) |
void |
handleException(String message,
Throwable exception) |
void |
handleException(Throwable exception) |
public BridgeExceptionHandlerToErrorHandler(DefaultConsumer consumer)
public void handleException(Throwable exception)
handleException
in interface org.apache.camel.spi.ExceptionHandler
public void handleException(String message, Throwable exception)
handleException
in interface org.apache.camel.spi.ExceptionHandler
Apache Camel