Class DefaultErrorHandlerDefinition
- java.lang.Object
-
- org.apache.camel.model.IdentifiedType
-
- org.apache.camel.model.errorhandler.DefaultErrorHandlerDefinition
-
- All Implemented Interfaces:
org.apache.camel.ErrorHandlerFactory
- Direct Known Subclasses:
DeadLetterChannelDefinition
,DefaultErrorHandlerBuilder
,TransactionErrorHandlerDefinition
@Metadata(label="configuration,error") public class DefaultErrorHandlerDefinition extends IdentifiedType
The default error handler.
-
-
Constructor Summary
Constructors Constructor Description DefaultErrorHandlerDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DefaultErrorHandlerDefinition
allowRedeliveryWhileStopping(boolean allowRedeliveryWhileStopping)
Controls whether to allow redelivery while stopping/shutting down a route that uses error handling.DefaultErrorHandlerDefinition
asyncDelayedRedelivery()
Will allow asynchronous delayed redeliveries.DefaultErrorHandlerDefinition
backOffMultiplier(double backOffMultiplier)
org.apache.camel.ErrorHandlerFactory
cloneBuilder()
protected void
cloneBuilder(DefaultErrorHandlerDefinition other)
DefaultErrorHandlerDefinition
collisionAvoidancePercent(double collisionAvoidancePercent)
protected RedeliveryPolicyDefinition
createRedeliveryPolicy()
DefaultErrorHandlerDefinition
delayPattern(String delayPattern)
DefaultErrorHandlerDefinition
disableRedelivery()
DefaultErrorHandlerDefinition
exchangeFormatterRef(String exchangeFormatterRef)
DefaultErrorHandlerDefinition
executorService(ScheduledExecutorService executorService)
Sets the thread pool to be used for redelivery.DefaultErrorHandlerDefinition
executorServiceRef(String ref)
Sets a reference to a thread pool to be used for redelivery.ScheduledExecutorService
getExecutorServiceBean()
String
getExecutorServiceRef()
String
getLevel()
org.apache.camel.spi.CamelLogger
getLoggerBean()
String
getLoggerRef()
String
getLogName()
org.apache.camel.Processor
getOnExceptionOccurredProcessor()
String
getOnExceptionOccurredRef()
org.apache.camel.Processor
getOnPrepareFailureProcessor()
String
getOnPrepareFailureRef()
org.apache.camel.Processor
getOnRedeliveryProcessor()
String
getOnRedeliveryRef()
RedeliveryPolicyDefinition
getRedeliveryPolicy()
String
getRedeliveryPolicyRef()
org.apache.camel.Predicate
getRetryWhilePredicate()
String
getRetryWhileRef()
String
getUseOriginalBody()
String
getUseOriginalMessage()
boolean
hasRedeliveryPolicy()
DefaultErrorHandlerDefinition
log(Class<?> log)
Sets the log used for caught exceptionsDefaultErrorHandlerDefinition
log(String log)
Sets the log used for caught exceptionsDefaultErrorHandlerDefinition
log(org.slf4j.Logger log)
Sets the log used for caught exceptionsDefaultErrorHandlerDefinition
logExhausted(boolean logExhausted)
DefaultErrorHandlerDefinition
logExhaustedMessageBody(boolean logExhaustedMessageBody)
DefaultErrorHandlerDefinition
logExhaustedMessageHistory(boolean logExhaustedMessageHistory)
DefaultErrorHandlerDefinition
logger(org.apache.camel.spi.CamelLogger logger)
Sets the logger used for caught exceptionsDefaultErrorHandlerDefinition
loggingLevel(String level)
Sets the logging level of exceptions caughtDefaultErrorHandlerDefinition
loggingLevel(org.apache.camel.LoggingLevel level)
Sets the logging level of exceptions caughtDefaultErrorHandlerDefinition
logHandled(boolean logHandled)
DefaultErrorHandlerDefinition
logNewException(boolean logNewException)
DefaultErrorHandlerDefinition
logRetryAttempted(boolean logRetryAttempted)
DefaultErrorHandlerDefinition
logRetryStackTrace(boolean logRetryStackTrace)
DefaultErrorHandlerDefinition
logStackTrace(boolean logStackTrace)
DefaultErrorHandlerDefinition
maximumRedeliveries(int maximumRedeliveries)
DefaultErrorHandlerDefinition
maximumRedeliveryDelay(long maximumRedeliveryDelay)
DefaultErrorHandlerDefinition
onExceptionOccurred(org.apache.camel.Processor processor)
Sets a customProcessor
to process theExchange
just after an exception was thrown.DefaultErrorHandlerDefinition
onExceptionOccurredRef(String onExceptionOccurredRef)
Sets a reference for the processor to use just after an exception was thrown.DefaultErrorHandlerDefinition
onPrepareFailure(org.apache.camel.Processor processor)
Sets a customProcessor
to prepare theExchange
before handled by the failure processor / dead letter channel.DefaultErrorHandlerDefinition
onPrepareFailureRef(String onPrepareFailureRef)
Sets a reference for the processor to use before handled by the failure processor.DefaultErrorHandlerDefinition
onRedelivery(org.apache.camel.Processor processor)
Sets a processor that should be processed before a redelivery attempt.DefaultErrorHandlerDefinition
onRedeliveryRef(String onRedeliveryRef)
Sets a reference for the processor to use before a redelivery attempt.DefaultErrorHandlerDefinition
redeliveryDelay(long delay)
DefaultErrorHandlerDefinition
redeliveryPolicyRef(String redeliveryPolicyRef)
Sets a reference to aRedeliveryPolicy
to be used for redelivery settings.DefaultErrorHandlerDefinition
retriesExhaustedLogLevel(org.apache.camel.LoggingLevel retriesExhaustedLogLevel)
DefaultErrorHandlerDefinition
retryAttemptedLogInterval(int retryAttemptedLogInterval)
DefaultErrorHandlerDefinition
retryAttemptedLogLevel(org.apache.camel.LoggingLevel retryAttemptedLogLevel)
DefaultErrorHandlerDefinition
retryWhile(org.apache.camel.Expression retryWhile)
Sets the retry while expression.DefaultErrorHandlerDefinition
retryWhileRef(String retryWhileRef)
void
setExecutorServiceBean(ScheduledExecutorService executorServiceBean)
Sets a thread pool to be used by the error handlervoid
setExecutorServiceRef(String executorServiceRef)
Sets a reference to a thread pool to be used by the error handlervoid
setLevel(String level)
Logging level to use when using the logging error handler type.void
setLoggerBean(org.apache.camel.spi.CamelLogger loggerBean)
void
setLoggerRef(String loggerRef)
References to a logger to use as logger for the error handlervoid
setLogName(String logName)
Name of the logger to use for the logging error handlervoid
setOnExceptionOccurredProcessor(org.apache.camel.Processor onExceptionOccurredProcessor)
Sets a processor that should be processed just after an exception occurred.void
setOnExceptionOccurredRef(String onExceptionOccurredRef)
Sets a reference to a processor that should be processed just after an exception occurred.void
setOnPrepareFailureProcessor(org.apache.camel.Processor onPrepareFailureProcessor)
Sets a processor to prepare theExchange
before handled by the failure processor / dead letter channel.void
setOnPrepareFailureRef(String onPrepareFailureRef)
Sets a reference to a processor to prepare theExchange
before handled by the failure processor / dead letter channel.void
setOnRedeliveryProcessor(org.apache.camel.Processor onRedeliveryProcessor)
Sets a processor that should be processed before a redelivery attempt.void
setOnRedeliveryRef(String onRedeliveryRef)
Sets a reference to a processor that should be processed before a redelivery attempt.void
setRedeliveryPolicy(RedeliveryPolicyDefinition redeliveryPolicy)
Sets the redelivery settingsvoid
setRedeliveryPolicyRef(String redeliveryPolicyRef)
Sets a reference to aRedeliveryPolicy
to be used for redelivery settings.void
setRetryWhilePredicate(org.apache.camel.Predicate retryWhilePredicate)
Sets a retry while predicate.void
setRetryWhileRef(String retryWhileRef)
Sets a retry while predicate.void
setUseOriginalBody(String useOriginalBody)
Will use the original inputMessage
body (original body only) when anExchange
is moved to the dead letter queue.void
setUseOriginalMessage(String useOriginalMessage)
Will use the original inputMessage
(original body and headers) when anExchange
is moved to the dead letter queue.boolean
supportTransacted()
DefaultErrorHandlerDefinition
useCollisionAvoidance()
DefaultErrorHandlerDefinition
useExponentialBackOff()
DefaultErrorHandlerDefinition
useOriginalBody()
Will use the original inputMessage
body (original body only) when anExchange
is moved to the dead letter queue.DefaultErrorHandlerDefinition
useOriginalMessage()
Will use the original inputMessage
(original body and headers) when anExchange
is moved to the dead letter queue.-
Methods inherited from class org.apache.camel.model.IdentifiedType
getId, setId
-
-
-
-
Method Detail
-
supportTransacted
public boolean supportTransacted()
-
cloneBuilder
public org.apache.camel.ErrorHandlerFactory cloneBuilder()
-
cloneBuilder
protected void cloneBuilder(DefaultErrorHandlerDefinition other)
-
createRedeliveryPolicy
protected RedeliveryPolicyDefinition createRedeliveryPolicy()
-
getLoggerRef
public String getLoggerRef()
-
setLoggerRef
public void setLoggerRef(String loggerRef)
References to a logger to use as logger for the error handler
-
getLoggerBean
public org.apache.camel.spi.CamelLogger getLoggerBean()
-
setLoggerBean
public void setLoggerBean(org.apache.camel.spi.CamelLogger loggerBean)
-
getLevel
public String getLevel()
-
setLevel
public void setLevel(String level)
Logging level to use when using the logging error handler type.
-
getLogName
public String getLogName()
-
setLogName
public void setLogName(String logName)
Name of the logger to use for the logging error handler
-
getUseOriginalMessage
public String getUseOriginalMessage()
-
setUseOriginalMessage
public void setUseOriginalMessage(String useOriginalMessage)
Will use the original inputMessage
(original body and headers) when anExchange
is moved to the dead letter queue. Notice: this only applies when all redeliveries attempt have failed and theExchange
is doomed for failure.
Instead of using the current inprogressExchange
IN message we use the original IN message instead. This allows you to store the original input in the dead letter queue instead of the inprogress snapshot of the IN message. For instance if you route transform the IN body during routing and then failed. With the original exchange store in the dead letter queue it might be easier to manually re submit theExchange
again as the IN message is the same as when Camel received it. So you should be able to send theExchange
to the same input. The difference between useOriginalMessage and useOriginalBody is that the former includes both the original body and headers, where as the latter only includes the original body. You can use the latter to enrich the message with custom headers and include the original message body. The former wont let you do this, as its using the original message body and headers as they are. You cannot enable both useOriginalMessage and useOriginalBody. Important: The original input means the input message that are bounded by the currentUnitOfWork
. An unit of work typically spans one route, or multiple routes if they are connected using internal endpoints such as direct or seda. When messages is passed via external endpoints such as JMS or HTTP then the consumer will create a new unit of work, with the message it received as input as the original input. Also some EIP patterns such as splitter, multicast, will create a new unit of work boundary for the messages in their sub-route (eg the splitted message); however these EIPs have an option named shareUnitOfWork which allows to combine with the parent unit of work in regard to error handling and therefore use the parent original message. By default this feature is off.
-
getUseOriginalBody
public String getUseOriginalBody()
-
setUseOriginalBody
public void setUseOriginalBody(String useOriginalBody)
Will use the original inputMessage
body (original body only) when anExchange
is moved to the dead letter queue. Notice: this only applies when all redeliveries attempt have failed and theExchange
is doomed for failure.
Instead of using the current inprogressExchange
IN message we use the original IN message instead. This allows you to store the original input in the dead letter queue instead of the inprogress snapshot of the IN message. For instance if you route transform the IN body during routing and then failed. With the original exchange store in the dead letter queue it might be easier to manually re submit theExchange
again as the IN message is the same as when Camel received it. So you should be able to send theExchange
to the same input. The difference between useOriginalMessage and useOriginalBody is that the former includes both the original body and headers, where as the latter only includes the original body. You can use the latter to enrich the message with custom headers and include the original message body. The former wont let you do this, as its using the original message body and headers as they are. You cannot enable both useOriginalMessage and useOriginalBody. Important: The original input means the input message that are bounded by the currentUnitOfWork
. An unit of work typically spans one route, or multiple routes if they are connected using internal endpoints such as direct or seda. When messages is passed via external endpoints such as JMS or HTTP then the consumer will create a new unit of work, with the message it received as input as the original input. Also some EIP patterns such as splitter, multicast, will create a new unit of work boundary for the messages in their sub-route (eg the splitted message); however these EIPs have an option named shareUnitOfWork which allows to combine with the parent unit of work in regard to error handling and therefore use the parent original message. By default this feature is off.
-
getOnRedeliveryRef
public String getOnRedeliveryRef()
-
setOnRedeliveryRef
public void setOnRedeliveryRef(String onRedeliveryRef)
Sets a reference to a processor that should be processed before a redelivery attempt. Can be used to change theExchange
before its being redelivered.
-
getOnRedeliveryProcessor
public org.apache.camel.Processor getOnRedeliveryProcessor()
-
setOnRedeliveryProcessor
public void setOnRedeliveryProcessor(org.apache.camel.Processor onRedeliveryProcessor)
Sets a processor that should be processed before a redelivery attempt. Can be used to change theExchange
before its being redelivered.
-
getOnExceptionOccurredRef
public String getOnExceptionOccurredRef()
-
setOnExceptionOccurredRef
public void setOnExceptionOccurredRef(String onExceptionOccurredRef)
Sets a reference to a processor that should be processed just after an exception occurred. Can be used to perform custom logging about the occurred exception at the exact time it happened. Important: Any exception thrown from this processor will be ignored.
-
getOnExceptionOccurredProcessor
public org.apache.camel.Processor getOnExceptionOccurredProcessor()
-
setOnExceptionOccurredProcessor
public void setOnExceptionOccurredProcessor(org.apache.camel.Processor onExceptionOccurredProcessor)
Sets a processor that should be processed just after an exception occurred. Can be used to perform custom logging about the occurred exception at the exact time it happened. Important: Any exception thrown from this processor will be ignored.
-
getOnPrepareFailureRef
public String getOnPrepareFailureRef()
-
setOnPrepareFailureRef
public void setOnPrepareFailureRef(String onPrepareFailureRef)
Sets a reference to a processor to prepare theExchange
before handled by the failure processor / dead letter channel. This allows for example to enrich the message before sending to a dead letter queue.
-
getOnPrepareFailureProcessor
public org.apache.camel.Processor getOnPrepareFailureProcessor()
-
setOnPrepareFailureProcessor
public void setOnPrepareFailureProcessor(org.apache.camel.Processor onPrepareFailureProcessor)
Sets a processor to prepare theExchange
before handled by the failure processor / dead letter channel. This allows for example to enrich the message before sending to a dead letter queue.
-
getRetryWhileRef
public String getRetryWhileRef()
-
setRetryWhileRef
public void setRetryWhileRef(String retryWhileRef)
Sets a retry while predicate. Will continue retrying until the predicate evaluates to false.
-
getRedeliveryPolicyRef
public String getRedeliveryPolicyRef()
-
setRedeliveryPolicyRef
public void setRedeliveryPolicyRef(String redeliveryPolicyRef)
Sets a reference to aRedeliveryPolicy
to be used for redelivery settings.
-
getExecutorServiceRef
public String getExecutorServiceRef()
-
setExecutorServiceRef
public void setExecutorServiceRef(String executorServiceRef)
Sets a reference to a thread pool to be used by the error handler
-
getExecutorServiceBean
public ScheduledExecutorService getExecutorServiceBean()
-
setExecutorServiceBean
public void setExecutorServiceBean(ScheduledExecutorService executorServiceBean)
Sets a thread pool to be used by the error handler
-
getRetryWhilePredicate
public org.apache.camel.Predicate getRetryWhilePredicate()
-
setRetryWhilePredicate
public void setRetryWhilePredicate(org.apache.camel.Predicate retryWhilePredicate)
Sets a retry while predicate. Will continue retrying until the predicate evaluates to false.
-
getRedeliveryPolicy
public RedeliveryPolicyDefinition getRedeliveryPolicy()
-
hasRedeliveryPolicy
public boolean hasRedeliveryPolicy()
-
setRedeliveryPolicy
public void setRedeliveryPolicy(RedeliveryPolicyDefinition redeliveryPolicy)
Sets the redelivery settings
-
backOffMultiplier
public DefaultErrorHandlerDefinition backOffMultiplier(double backOffMultiplier)
-
collisionAvoidancePercent
public DefaultErrorHandlerDefinition collisionAvoidancePercent(double collisionAvoidancePercent)
-
redeliveryDelay
public DefaultErrorHandlerDefinition redeliveryDelay(long delay)
-
delayPattern
public DefaultErrorHandlerDefinition delayPattern(String delayPattern)
-
maximumRedeliveries
public DefaultErrorHandlerDefinition maximumRedeliveries(int maximumRedeliveries)
-
disableRedelivery
public DefaultErrorHandlerDefinition disableRedelivery()
-
maximumRedeliveryDelay
public DefaultErrorHandlerDefinition maximumRedeliveryDelay(long maximumRedeliveryDelay)
-
useCollisionAvoidance
public DefaultErrorHandlerDefinition useCollisionAvoidance()
-
useExponentialBackOff
public DefaultErrorHandlerDefinition useExponentialBackOff()
-
retriesExhaustedLogLevel
public DefaultErrorHandlerDefinition retriesExhaustedLogLevel(org.apache.camel.LoggingLevel retriesExhaustedLogLevel)
-
retryAttemptedLogLevel
public DefaultErrorHandlerDefinition retryAttemptedLogLevel(org.apache.camel.LoggingLevel retryAttemptedLogLevel)
-
retryAttemptedLogInterval
public DefaultErrorHandlerDefinition retryAttemptedLogInterval(int retryAttemptedLogInterval)
-
logStackTrace
public DefaultErrorHandlerDefinition logStackTrace(boolean logStackTrace)
-
logRetryStackTrace
public DefaultErrorHandlerDefinition logRetryStackTrace(boolean logRetryStackTrace)
-
logHandled
public DefaultErrorHandlerDefinition logHandled(boolean logHandled)
-
logNewException
public DefaultErrorHandlerDefinition logNewException(boolean logNewException)
-
logExhausted
public DefaultErrorHandlerDefinition logExhausted(boolean logExhausted)
-
logRetryAttempted
public DefaultErrorHandlerDefinition logRetryAttempted(boolean logRetryAttempted)
-
logExhaustedMessageHistory
public DefaultErrorHandlerDefinition logExhaustedMessageHistory(boolean logExhaustedMessageHistory)
-
logExhaustedMessageBody
public DefaultErrorHandlerDefinition logExhaustedMessageBody(boolean logExhaustedMessageBody)
-
exchangeFormatterRef
public DefaultErrorHandlerDefinition exchangeFormatterRef(String exchangeFormatterRef)
-
asyncDelayedRedelivery
public DefaultErrorHandlerDefinition asyncDelayedRedelivery()
Will allow asynchronous delayed redeliveries. The route, in particular the consumer's component, must support the Asynchronous Routing Engine (e.g. seda)- Returns:
- the builder
- See Also:
RedeliveryPolicy.setAsyncDelayedRedelivery(boolean)
-
allowRedeliveryWhileStopping
public DefaultErrorHandlerDefinition allowRedeliveryWhileStopping(boolean allowRedeliveryWhileStopping)
Controls whether to allow redelivery while stopping/shutting down a route that uses error handling.- Parameters:
allowRedeliveryWhileStopping
- true to allow redelivery, false to reject redeliveries- Returns:
- the builder
-
executorService
public DefaultErrorHandlerDefinition executorService(ScheduledExecutorService executorService)
Sets the thread pool to be used for redelivery.- Parameters:
executorService
- the scheduled thread pool to use- Returns:
- the builder.
-
executorServiceRef
public DefaultErrorHandlerDefinition executorServiceRef(String ref)
Sets a reference to a thread pool to be used for redelivery.- Parameters:
ref
- reference to a scheduled thread pool- Returns:
- the builder.
-
logger
public DefaultErrorHandlerDefinition logger(org.apache.camel.spi.CamelLogger logger)
Sets the logger used for caught exceptions- Parameters:
logger
- the logger- Returns:
- the builder
-
loggingLevel
public DefaultErrorHandlerDefinition loggingLevel(String level)
Sets the logging level of exceptions caught- Parameters:
level
- the logging level- Returns:
- the builder
-
loggingLevel
public DefaultErrorHandlerDefinition loggingLevel(org.apache.camel.LoggingLevel level)
Sets the logging level of exceptions caught- Parameters:
level
- the logging level- Returns:
- the builder
-
log
public DefaultErrorHandlerDefinition log(org.slf4j.Logger log)
Sets the log used for caught exceptions- Parameters:
log
- the logger- Returns:
- the builder
-
log
public DefaultErrorHandlerDefinition log(String log)
Sets the log used for caught exceptions- Parameters:
log
- the log name- Returns:
- the builder
-
log
public DefaultErrorHandlerDefinition log(Class<?> log)
Sets the log used for caught exceptions- Parameters:
log
- the log class- Returns:
- the builder
-
onRedelivery
public DefaultErrorHandlerDefinition onRedelivery(org.apache.camel.Processor processor)
Sets a processor that should be processed before a redelivery attempt. Can be used to change theExchange
before its being redelivered.- Parameters:
processor
- the processor- Returns:
- the builder
-
onRedeliveryRef
public DefaultErrorHandlerDefinition onRedeliveryRef(String onRedeliveryRef)
Sets a reference for the processor to use before a redelivery attempt.- Parameters:
onRedeliveryRef
- the processor's reference- Returns:
- the builder
- See Also:
onRedelivery(Processor)
-
retryWhile
public DefaultErrorHandlerDefinition retryWhile(org.apache.camel.Expression retryWhile)
Sets the retry while expression. Will continue retrying until expression evaluates to false.- Parameters:
retryWhile
- expression that determines when to stop retrying- Returns:
- the builder
-
retryWhileRef
public DefaultErrorHandlerDefinition retryWhileRef(String retryWhileRef)
-
useOriginalMessage
public DefaultErrorHandlerDefinition useOriginalMessage()
Will use the original inputMessage
(original body and headers) when anExchange
is moved to the dead letter queue. Notice: this only applies when all redeliveries attempt have failed and theExchange
is doomed for failure.
Instead of using the current inprogressExchange
IN message we use the original IN message instead. This allows you to store the original input in the dead letter queue instead of the inprogress snapshot of the IN message. For instance if you route transform the IN body during routing and then failed. With the original exchange store in the dead letter queue it might be easier to manually re submit theExchange
again as the IN message is the same as when Camel received it. So you should be able to send theExchange
to the same input. The difference between useOriginalMessage and useOriginalBody is that the former includes both the original body and headers, where as the latter only includes the original body. You can use the latter to enrich the message with custom headers and include the original message body. The former wont let you do this, as its using the original message body and headers as they are. You cannot enable both useOriginalMessage and useOriginalBody. Important: The original input means the input message that are bounded by the currentUnitOfWork
. An unit of work typically spans one route, or multiple routes if they are connected using internal endpoints such as direct or seda. When messages is passed via external endpoints such as JMS or HTTP then the consumer will create a new unit of work, with the message it received as input as the original input. Also some EIP patterns such as splitter, multicast, will create a new unit of work boundary for the messages in their sub-route (eg the split message); however these EIPs have an option named shareUnitOfWork which allows to combine with the parent unit of work in regard to error handling and therefore use the parent original message. By default this feature is off.- Returns:
- the builder
- See Also:
useOriginalBody()
-
useOriginalBody
public DefaultErrorHandlerDefinition useOriginalBody()
Will use the original inputMessage
body (original body only) when anExchange
is moved to the dead letter queue. Notice: this only applies when all redeliveries attempt have failed and theExchange
is doomed for failure.
Instead of using the current inprogressExchange
IN message we use the original IN message instead. This allows you to store the original input in the dead letter queue instead of the inprogress snapshot of the IN message. For instance if you route transform the IN body during routing and then failed. With the original exchange store in the dead letter queue it might be easier to manually re submit theExchange
again as the IN message is the same as when Camel received it. So you should be able to send theExchange
to the same input. The difference between useOriginalMessage and useOriginalBody is that the former includes both the original body and headers, where as the latter only includes the original body. You can use the latter to enrich the message with custom headers and include the original message body. The former wont let you do this, as its using the original message body and headers as they are. You cannot enable both useOriginalMessage and useOriginalBody. Important: The original input means the input message that are bounded by the currentUnitOfWork
. An unit of work typically spans one route, or multiple routes if they are connected using internal endpoints such as direct or seda. When messages is passed via external endpoints such as JMS or HTTP then the consumer will create a new unit of work, with the message it received as input as the original input. Also some EIP patterns such as splitter, multicast, will create a new unit of work boundary for the messages in their sub-route (eg the split message); however these EIPs have an option named shareUnitOfWork which allows to combine with the parent unit of work in regard to error handling and therefore use the parent original message. By default this feature is off.- Returns:
- the builder
- See Also:
useOriginalMessage()
-
onPrepareFailure
public DefaultErrorHandlerDefinition onPrepareFailure(org.apache.camel.Processor processor)
Sets a customProcessor
to prepare theExchange
before handled by the failure processor / dead letter channel. This allows for example to enrich the message before sending to a dead letter queue.- Parameters:
processor
- the processor- Returns:
- the builder
-
onPrepareFailureRef
public DefaultErrorHandlerDefinition onPrepareFailureRef(String onPrepareFailureRef)
Sets a reference for the processor to use before handled by the failure processor.- Parameters:
onPrepareFailureRef
- the processor's reference- Returns:
- the builder
- See Also:
onPrepareFailure(Processor)
-
onExceptionOccurred
public DefaultErrorHandlerDefinition onExceptionOccurred(org.apache.camel.Processor processor)
Sets a customProcessor
to process theExchange
just after an exception was thrown. This allows to execute the processor at the same time the exception was thrown. Important: Any exception thrown from this processor will be ignored.- Parameters:
processor
- the processor- Returns:
- the builder
-
onExceptionOccurredRef
public DefaultErrorHandlerDefinition onExceptionOccurredRef(String onExceptionOccurredRef)
Sets a reference for the processor to use just after an exception was thrown.- Parameters:
onExceptionOccurredRef
- the processor's reference- Returns:
- the builder
- See Also:
onExceptionOccurred(Processor)
-
redeliveryPolicyRef
public DefaultErrorHandlerDefinition redeliveryPolicyRef(String redeliveryPolicyRef)
Sets a reference to aRedeliveryPolicy
to be used for redelivery settings.- Parameters:
redeliveryPolicyRef
- the redelivrey policy reference- Returns:
- the builder
-
-