Package org.apache.camel.model
Class OnExceptionDefinition
- java.lang.Object
-
- org.apache.camel.model.OptionalIdentifiedDefinition<Type>
-
- org.apache.camel.model.ProcessorDefinition<Type>
-
- org.apache.camel.model.OutputDefinition<OnExceptionDefinition>
-
- org.apache.camel.model.OnExceptionDefinition
-
- All Implemented Interfaces:
org.apache.camel.CamelContextAware,org.apache.camel.LineNumberAware,Block,OutputNode,org.apache.camel.NamedNode,org.apache.camel.spi.HasId,org.apache.camel.spi.IdAware
@Metadata(label="error") public class OnExceptionDefinition extends OutputDefinition<OnExceptionDefinition>
Route to be executed when an exception is thrown
-
-
Field Summary
-
Fields inherited from class org.apache.camel.model.OutputDefinition
outputs
-
Fields inherited from class org.apache.camel.model.ProcessorDefinition
inheritErrorHandler
-
-
Constructor Summary
Constructors Constructor Description OnExceptionDefinition()OnExceptionDefinition(Class<? extends Throwable> exceptionType)OnExceptionDefinition(List<Class<? extends Throwable>> exceptionClasses)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OnExceptionDefinitionasyncDelayedRedelivery()Allow asynchronous delayed redelivery.OnExceptionDefinitionbackOffMultiplier(double backOffMultiplier)Sets the back off multiplierOnExceptionDefinitionbackOffMultiplier(String backOffMultiplier)Sets the back off multiplier (supports property placeholders)OnExceptionDefinitioncollisionAvoidanceFactor(double collisionAvoidanceFactor)Sets the collision avoidance factorOnExceptionDefinitioncollisionAvoidanceFactor(String collisionAvoidanceFactor)Sets the collision avoidance factor (supports property placeholders)OnExceptionDefinitioncollisionAvoidancePercent(double collisionAvoidancePercent)Sets the collision avoidance percentageOnExceptionDefinitioncontinued(boolean continued)Sets whether the exchange should handle and continue routing from the point of failure.OnExceptionDefinitioncontinued(org.apache.camel.Expression continued)Sets whether the exchange should be marked as handled or not.OnExceptionDefinitioncontinued(org.apache.camel.Predicate continued)Sets whether the exchange should be marked as handled or not.OnExceptionDefinitiondelayPattern(String delayPattern)Sets the delay pattern with delay intervals.protected Stringdescription()ExpressionSubElementDefinitiongetContinued()org.apache.camel.PredicategetContinuedPolicy()List<String>getExceptions()ExpressionSubElementDefinitiongetHandled()org.apache.camel.PredicategetHandledPolicy()StringgetLabel()Returns a label to describe this node such as the expression if some kind of expression nodeorg.apache.camel.ProcessorgetOnExceptionOccurred()StringgetOnExceptionOccurredRef()org.apache.camel.ProcessorgetOnRedelivery()StringgetOnRedeliveryRef()WhenDefinitiongetOnWhen()protected RedeliveryPolicyDefinitiongetOrCreateRedeliveryPolicy()List<ProcessorDefinition<?>>getOutputs()StringgetRedeliveryPolicyRef()RedeliveryPolicyDefinitiongetRedeliveryPolicyType()ExpressionSubElementDefinitiongetRetryWhile()org.apache.camel.PredicategetRetryWhilePolicy()StringgetShortName()StringgetUseOriginalBody()StringgetUseOriginalMessage()OnExceptionDefinitionhandled(boolean handled)Sets whether the exchange should be marked as handled or not.OnExceptionDefinitionhandled(org.apache.camel.Expression handled)Sets whether the exchange should be marked as handled or not.OnExceptionDefinitionhandled(org.apache.camel.Predicate handled)Sets whether the exchange should be marked as handled or not.booleanisAbstract()Whether this model is abstract or not.booleanisRouteScoped()booleanisTopLevelOnly()Whether this definition can only be added as top-level directly on the route itself (such as onException,onCompletion,intercept, etc.)OnExceptionDefinitionlogContinued(boolean logContinued)Sets whether to log errors even if its continuedOnExceptionDefinitionlogContinued(String logContinued)Sets whether to log errors even if its continued (supports property placeholders)OnExceptionDefinitionlogExhausted(boolean logExhausted)Sets whether to log exhausted exceptionsOnExceptionDefinitionlogExhausted(String logExhausted)Sets whether to log exhausted exceptions (supports property placeholders)OnExceptionDefinitionlogExhaustedMessageBody(boolean logExhaustedMessageBody)Sets whether to log exhausted message body with message history.OnExceptionDefinitionlogExhaustedMessageBody(String logExhaustedMessageBody)Sets whether to log exhausted message body with message history.OnExceptionDefinitionlogExhaustedMessageHistory(boolean logExhaustedMessageHistory)Sets whether to log exhausted exceptions with message historyOnExceptionDefinitionlogExhaustedMessageHistory(String logExhaustedMessageHistory)Sets whether to log exhausted exceptions with message historyOnExceptionDefinitionlogHandled(boolean logHandled)Sets whether to log errors even if its handledOnExceptionDefinitionlogHandled(String logHandled)Sets whether to log errors even if its handled (supports property placeholders)OnExceptionDefinitionlogNewException(boolean logNewException)Sets whether new exceptions should be logged or not (supports property placeholders).OnExceptionDefinitionlogNewException(String logNewException)Sets whether new exceptions should be logged or not (supports property placeholders).OnExceptionDefinitionlogRetryAttempted(boolean logRetryAttempted)Sets whether to log retry attemptsOnExceptionDefinitionlogRetryAttempted(String logRetryAttempted)Sets whether to log retry attempts (supports property placeholders)OnExceptionDefinitionlogRetryStackTrace(boolean logRetryStackTrace)Sets whether to log stacktrace for failed redelivery attemptsOnExceptionDefinitionlogRetryStackTrace(String logRetryStackTrace)Sets whether to log stacktrace for failed redelivery attempts (supports property placeholders)OnExceptionDefinitionlogStackTrace(boolean logStackTrace)Sets whether to log stacktrace for failed messages.OnExceptionDefinitionlogStackTrace(String logStackTrace)Sets whether to log stacktrace for failed messages (supports property placeholders)OnExceptionDefinitionmaximumRedeliveries(int maximumRedeliveries)Sets the maximum redeliveries 5 = default value 0 = no redeliveries -1 = redeliver foreverOnExceptionDefinitionmaximumRedeliveries(String maximumRedeliveries)Sets the maximum redeliveries (supports property placeholders) 5 = default value 0 = no redeliveries -1 = redeliver foreverOnExceptionDefinitionmaximumRedeliveryDelay(long maximumRedeliveryDelay)Sets the maximum delay between redeliveryOnExceptionDefinitionmaximumRedeliveryDelay(String maximumRedeliveryDelay)Sets the maximum delay between redelivery (supports property placeholders)OnExceptionDefinitiononException(Class<? extends Throwable> exceptionType)Exception clause for catching certain exceptions and handling them.OnExceptionDefinitiononExceptionOccurred(org.apache.camel.Processor processor)Sets a processor that should be processed just after an exception occurred.OnExceptionDefinitiononExceptionOccurredRef(String ref)Sets a reference to a processor that should be processed just after an exception occurred.OnExceptionDefinitiononRedelivery(org.apache.camel.Processor processor)Sets a processor that should be processed before a redelivery attempt.OnExceptionDefinitiononRedeliveryRef(String ref)Sets a reference to a processor that should be processed before a redelivery attempt.OnExceptionDefinitiononWhen(org.apache.camel.Predicate predicate)Sets an additional predicate that should be true before the onException is triggered.OnExceptionDefinitionredeliveryDelay(long delay)Sets the initial redelivery delayOnExceptionDefinitionredeliveryDelay(String delay)Sets the initial redelivery delay (supports property placeholders)OnExceptionDefinitionredeliveryPolicyRef(String redeliveryPolicyRef)Sets a reference to a redelivery policy to lookup in theRegistryto be used.OnExceptionDefinitionretriesExhaustedLogLevel(org.apache.camel.LoggingLevel retriesExhaustedLogLevel)Sets the logging level to use when retries have been exhaustedOnExceptionDefinitionretryAttemptedLogLevel(org.apache.camel.LoggingLevel retryAttemptedLogLevel)Sets the logging level to use for logging retry attemptsOnExceptionDefinitionretryWhile(org.apache.camel.Predicate retryWhile)Sets the retry while predicate.voidsetContinued(ExpressionSubElementDefinition continued)voidsetContinuedPolicy(org.apache.camel.Predicate continuedPolicy)voidsetExceptions(List<String> exceptions)A set of exceptions to react upon.voidsetHandled(ExpressionSubElementDefinition handled)voidsetHandledPolicy(org.apache.camel.Predicate handledPolicy)voidsetOnExceptionOccurred(org.apache.camel.Processor onExceptionOccurred)voidsetOnExceptionOccurredRef(String onExceptionOccurredRef)voidsetOnRedelivery(org.apache.camel.Processor onRedelivery)voidsetOnRedeliveryRef(String onRedeliveryRef)voidsetOnWhen(WhenDefinition onWhen)voidsetOutputs(List<ProcessorDefinition<?>> outputs)voidsetParent(ProcessorDefinition<?> parent)voidsetRedeliveryPolicyRef(String redeliveryPolicyRef)voidsetRedeliveryPolicyType(RedeliveryPolicyDefinition redeliveryPolicyType)Used for configuring redelivery optionsvoidsetRetryWhile(ExpressionSubElementDefinition retryWhile)voidsetRetryWhilePolicy(org.apache.camel.Predicate retryWhilePolicy)voidsetRouteScoped(boolean routeScoped)voidsetUseOriginalBody(String useOriginalBody)voidsetUseOriginalMessage(String useOriginalMessage)StringtoString()OnExceptionDefinitionuseCollisionAvoidance()Turn on collision avoidance.OnExceptionDefinitionuseExponentialBackOff()Turn on exponential back offOnExceptionDefinitionuseOriginalBody()Will use the original inputMessagebody (original body only) when anExchangeis moved to the dead letter queue.OnExceptionDefinitionuseOriginalMessage()Will use the original inputMessage(original body and headers) when anExchangeis moved to the dead letter queue.voidvalidateConfiguration()-
Methods inherited from class org.apache.camel.model.ProcessorDefinition
addInterceptStrategy, addOutput, aggregate, aggregate, aggregate, aggregate, bean, bean, bean, bean, bean, bean, bean, bean, bean, bean, bean, choice, circuitBreaker, claimCheck, claimCheck, claimCheck, claimCheck, clearOutput, configureChild, convertBodyTo, convertBodyTo, convertBodyTo, delay, delay, delay, doTry, dynamicRouter, dynamicRouter, end, endChoice, endCircuitBreaker, endDoCatch, endDoTry, endParent, enrich, enrich, enrich, enrich, enrich, enrich, enrich, enrich, enrich, enrichWith, enrichWith, enrichWith, enrichWith, enrichWith, enrichWith, filter, filter, filter, filter, getIndex, getInterceptStrategies, getParent, getRouteConfiguration, id, idempotentConsumer, idempotentConsumer, idempotentConsumer, inheritErrorHandler, inOnly, inOnly, inOnly, inOnly, inOnly, inOut, inOut, inOut, inOut, inOut, isInheritErrorHandler, isWrappingEntireOutput, kamelet, loadBalance, loadBalance, log, log, log, log, log, log, loop, loop, loop, loopDoWhile, loopDoWhile, markRollbackOnly, markRollbackOnlyLast, marshal, marshal, marshal, marshal, multicast, multicast, multicast, onCompletion, onException, pausable, pausable, pausable, pausable, pipeline, pipeline, pipeline, pipeline, policy, policy, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollEnrichWith, pollEnrichWith, preCreateProcessor, process, process, process, recipientList, recipientList, recipientList, recipientList, removeHeader, removeHeaders, removeHeaders, removeProperties, removeProperties, removeProperty, resequence, resequence, resumable, resumable, resumable, rollback, rollback, routeDescription, routeGroup, routeId, routingSlip, routingSlip, routingSlip, saga, sample, sample, sample, sample, sample, script, script, serviceCall, serviceCall, serviceCall, setBody, setBody, setBody, setExchangePattern, setExchangePattern, setHeader, setHeader, setHeader, setInheritErrorHandler, setProperty, setProperty, setProperty, setRouteConfiguration, sort, sort, sort, split, split, split, split, startupOrder, step, step, stop, threads, threads, threads, threads, throttle, throttle, throttle, throttle, throttle, throwException, throwException, to, to, to, to, to, to, to, to, to, to, to, to, to, to, toD, toD, toD, toD, toD, toD, toD, toF, transacted, transacted, transform, transform, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, unmarshal, validate, validate, validate, wireTap, wireTap, wireTap
-
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition
description, description, getCamelContext, getCustomId, getDescription, getDescriptionText, getId, getLineNumber, getLocation, hasCustomIdAssigned, idOrCreate, setCamelContext, setCustomId, setDescription, setGeneratedId, setId, setLineNumber, setLocation
-
-
-
-
Method Detail
-
setRouteScoped
public void setRouteScoped(boolean routeScoped)
-
isRouteScoped
public boolean isRouteScoped()
-
setParent
public void setParent(ProcessorDefinition<?> parent)
- Overrides:
setParentin classProcessorDefinition<OnExceptionDefinition>
-
toString
public String toString()
- Overrides:
toStringin classOutputDefinition<OnExceptionDefinition>
-
description
protected String description()
-
getShortName
public String getShortName()
- Specified by:
getShortNamein interfaceorg.apache.camel.NamedNode- Overrides:
getShortNamein classOutputDefinition<OnExceptionDefinition>
-
getLabel
public String getLabel()
Description copied from class:ProcessorDefinitionReturns a label to describe this node such as the expression if some kind of expression node- Specified by:
getLabelin interfaceorg.apache.camel.NamedNode- Overrides:
getLabelin classProcessorDefinition<OnExceptionDefinition>
-
isAbstract
public boolean isAbstract()
Description copied from class:ProcessorDefinitionWhether this model is abstract or not. An abstract model is something that is used for configuring cross cutting concerns such as error handling, transaction policies, interceptors etc. Regular definitions is what is part of the route, such as ToDefinition, WireTapDefinition and the likes. Will by default return false to indicate regular definition, so all the abstract definitions must override this method and return true instead. This information is used in camel-spring to let Camel work a bit on the model provided by JAXB from the Spring XML file. This is needed to handle those cross cutting concerns properly. The Java DSL does not have this issue as it can work this out directly using the fluent builder methods.- Overrides:
isAbstractin classProcessorDefinition<OnExceptionDefinition>- Returns:
- true for abstract, otherwise false for regular.
-
isTopLevelOnly
public boolean isTopLevelOnly()
Description copied from class:ProcessorDefinitionWhether this definition can only be added as top-level directly on the route itself (such as onException,onCompletion,intercept, etc.) If trying to add a top-level only definition to a nested output would fail in theProcessorDefinition.addOutput(ProcessorDefinition)method.- Overrides:
isTopLevelOnlyin classProcessorDefinition<OnExceptionDefinition>
-
validateConfiguration
public void validateConfiguration()
-
onException
public OnExceptionDefinition onException(Class<? extends Throwable> exceptionType)
Description copied from class:ProcessorDefinitionException clause for catching certain exceptions and handling them.- Overrides:
onExceptionin classProcessorDefinition<OnExceptionDefinition>- Parameters:
exceptionType- the exception to catch- Returns:
- the exception builder to configure
-
handled
public OnExceptionDefinition handled(boolean handled)
Sets whether the exchange should be marked as handled or not.- Parameters:
handled- handled or not- Returns:
- the builder
-
handled
public OnExceptionDefinition handled(@AsPredicate org.apache.camel.Predicate handled)
Sets whether the exchange should be marked as handled or not.- Parameters:
handled- predicate that determines true or false- Returns:
- the builder
-
handled
public OnExceptionDefinition handled(@AsPredicate org.apache.camel.Expression handled)
Sets whether the exchange should be marked as handled or not.- Parameters:
handled- expression that determines true or false- Returns:
- the builder
-
continued
public OnExceptionDefinition continued(boolean continued)
Sets whether the exchange should handle and continue routing from the point of failure. If this option is enabled then its considered handled as well.- Parameters:
continued- continued or not- Returns:
- the builder
-
continued
public OnExceptionDefinition continued(@AsPredicate org.apache.camel.Predicate continued)
Sets whether the exchange should be marked as handled or not. If this option is enabled then its considered handled as well.- Parameters:
continued- predicate that determines true or false- Returns:
- the builder
-
continued
public OnExceptionDefinition continued(@AsPredicate org.apache.camel.Expression continued)
Sets whether the exchange should be marked as handled or not. If this option is enabled then its considered handled as well.- Parameters:
continued- expression that determines true or false- Returns:
- the builder
-
onWhen
public OnExceptionDefinition onWhen(@AsPredicate org.apache.camel.Predicate predicate)
Sets an additional predicate that should be true before the onException is triggered. To be used for fine grained controlling whether a thrown exception should be intercepted by this exception type or not.- Parameters:
predicate- predicate that determines true or false- Returns:
- the builder
-
retryWhile
public OnExceptionDefinition retryWhile(@AsPredicate org.apache.camel.Predicate retryWhile)
Sets the retry while predicate. Will continue retrying until predicate returns false.- Parameters:
retryWhile- predicate that determines when to stop retrying- Returns:
- the builder
-
backOffMultiplier
public OnExceptionDefinition backOffMultiplier(double backOffMultiplier)
Sets the back off multiplier- Parameters:
backOffMultiplier- the back off multiplier- Returns:
- the builder
-
backOffMultiplier
public OnExceptionDefinition backOffMultiplier(String backOffMultiplier)
Sets the back off multiplier (supports property placeholders)- Parameters:
backOffMultiplier- the back off multiplier- Returns:
- the builder
-
collisionAvoidanceFactor
public OnExceptionDefinition collisionAvoidanceFactor(double collisionAvoidanceFactor)
Sets the collision avoidance factor- Parameters:
collisionAvoidanceFactor- the factor- Returns:
- the builder
-
collisionAvoidanceFactor
public OnExceptionDefinition collisionAvoidanceFactor(String collisionAvoidanceFactor)
Sets the collision avoidance factor (supports property placeholders)- Parameters:
collisionAvoidanceFactor- the factor- Returns:
- the builder
-
collisionAvoidancePercent
public OnExceptionDefinition collisionAvoidancePercent(double collisionAvoidancePercent)
Sets the collision avoidance percentage- Parameters:
collisionAvoidancePercent- the percentage- Returns:
- the builder
-
redeliveryDelay
public OnExceptionDefinition redeliveryDelay(long delay)
Sets the initial redelivery delay- Parameters:
delay- delay in millis- Returns:
- the builder
-
redeliveryDelay
public OnExceptionDefinition redeliveryDelay(String delay)
Sets the initial redelivery delay (supports property placeholders)- Parameters:
delay- delay in millis- Returns:
- the builder
-
asyncDelayedRedelivery
public OnExceptionDefinition asyncDelayedRedelivery()
Allow asynchronous delayed redelivery.- Returns:
- the builder
-
retriesExhaustedLogLevel
public OnExceptionDefinition retriesExhaustedLogLevel(org.apache.camel.LoggingLevel retriesExhaustedLogLevel)
Sets the logging level to use when retries have been exhausted- Parameters:
retriesExhaustedLogLevel- the logging level- Returns:
- the builder
-
retryAttemptedLogLevel
public OnExceptionDefinition retryAttemptedLogLevel(org.apache.camel.LoggingLevel retryAttemptedLogLevel)
Sets the logging level to use for logging retry attempts- Parameters:
retryAttemptedLogLevel- the logging level- Returns:
- the builder
-
logStackTrace
public OnExceptionDefinition logStackTrace(boolean logStackTrace)
Sets whether to log stacktrace for failed messages.
-
logStackTrace
public OnExceptionDefinition logStackTrace(String logStackTrace)
Sets whether to log stacktrace for failed messages (supports property placeholders)
-
logRetryStackTrace
public OnExceptionDefinition logRetryStackTrace(boolean logRetryStackTrace)
Sets whether to log stacktrace for failed redelivery attempts
-
logRetryStackTrace
public OnExceptionDefinition logRetryStackTrace(String logRetryStackTrace)
Sets whether to log stacktrace for failed redelivery attempts (supports property placeholders)
-
logHandled
public OnExceptionDefinition logHandled(boolean logHandled)
Sets whether to log errors even if its handled
-
logHandled
public OnExceptionDefinition logHandled(String logHandled)
Sets whether to log errors even if its handled (supports property placeholders)
-
logNewException
public OnExceptionDefinition logNewException(boolean logNewException)
Sets whether new exceptions should be logged or not (supports property placeholders). Can be used to include or reduce verbose. A new exception is an exception that was thrown while handling a previous exception.
-
logNewException
public OnExceptionDefinition logNewException(String logNewException)
Sets whether new exceptions should be logged or not (supports property placeholders). Can be used to include or reduce verbose. A new exception is an exception that was thrown while handling a previous exception.
-
logContinued
public OnExceptionDefinition logContinued(boolean logContinued)
Sets whether to log errors even if its continued
-
logContinued
public OnExceptionDefinition logContinued(String logContinued)
Sets whether to log errors even if its continued (supports property placeholders)
-
logRetryAttempted
public OnExceptionDefinition logRetryAttempted(boolean logRetryAttempted)
Sets whether to log retry attempts
-
logRetryAttempted
public OnExceptionDefinition logRetryAttempted(String logRetryAttempted)
Sets whether to log retry attempts (supports property placeholders)
-
logExhausted
public OnExceptionDefinition logExhausted(boolean logExhausted)
Sets whether to log exhausted exceptions
-
logExhausted
public OnExceptionDefinition logExhausted(String logExhausted)
Sets whether to log exhausted exceptions (supports property placeholders)
-
logExhaustedMessageHistory
public OnExceptionDefinition logExhaustedMessageHistory(boolean logExhaustedMessageHistory)
Sets whether to log exhausted exceptions with message history
-
logExhaustedMessageHistory
public OnExceptionDefinition logExhaustedMessageHistory(String logExhaustedMessageHistory)
Sets whether to log exhausted exceptions with message history
-
logExhaustedMessageBody
public OnExceptionDefinition logExhaustedMessageBody(boolean logExhaustedMessageBody)
Sets whether to log exhausted message body with message history. Requires logExhaustedMessageHistory to be enabled.
-
logExhaustedMessageBody
public OnExceptionDefinition logExhaustedMessageBody(String logExhaustedMessageBody)
Sets whether to log exhausted message body with message history. Requires logExhaustedMessageHistory to be enabled.
-
maximumRedeliveries
public OnExceptionDefinition maximumRedeliveries(int maximumRedeliveries)
Sets the maximum redeliveries- 5 = default value
- 0 = no redeliveries
- -1 = redeliver forever
- Parameters:
maximumRedeliveries- the value- Returns:
- the builder
-
maximumRedeliveries
public OnExceptionDefinition maximumRedeliveries(String maximumRedeliveries)
Sets the maximum redeliveries (supports property placeholders)- 5 = default value
- 0 = no redeliveries
- -1 = redeliver forever
- Parameters:
maximumRedeliveries- the value- Returns:
- the builder
-
useCollisionAvoidance
public OnExceptionDefinition useCollisionAvoidance()
Turn on collision avoidance.- Returns:
- the builder
-
useExponentialBackOff
public OnExceptionDefinition useExponentialBackOff()
Turn on exponential back off- Returns:
- the builder
-
maximumRedeliveryDelay
public OnExceptionDefinition maximumRedeliveryDelay(long maximumRedeliveryDelay)
Sets the maximum delay between redelivery- Parameters:
maximumRedeliveryDelay- the delay in millis- Returns:
- the builder
-
maximumRedeliveryDelay
public OnExceptionDefinition maximumRedeliveryDelay(String maximumRedeliveryDelay)
Sets the maximum delay between redelivery (supports property placeholders)- Parameters:
maximumRedeliveryDelay- the delay in millis- Returns:
- the builder
-
redeliveryPolicyRef
public OnExceptionDefinition redeliveryPolicyRef(String redeliveryPolicyRef)
Sets a reference to a redelivery policy to lookup in theRegistryto be used.- Parameters:
redeliveryPolicyRef- reference to use for lookup- Returns:
- the builder
-
delayPattern
public OnExceptionDefinition delayPattern(String delayPattern)
Sets the delay pattern with delay intervals.- Parameters:
delayPattern- the delay pattern- Returns:
- the builder
-
useOriginalMessage
public OnExceptionDefinition useOriginalMessage()
Will use the original inputMessage(original body and headers) when anExchangeis moved to the dead letter queue. Notice: this only applies when all redeliveries attempt have failed and theExchangeis doomed for failure.
Instead of using the current inprogressExchangeIN 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 theExchangeagain as the IN message is the same as when Camel received it. So you should be able to send theExchangeto 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 OnExceptionDefinition useOriginalBody()
Will use the original inputMessagebody (original body only) when anExchangeis moved to the dead letter queue. Notice: this only applies when all redeliveries attempt have failed and theExchangeis doomed for failure.
Instead of using the current inprogressExchangeIN 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 theExchangeagain as the IN message is the same as when Camel received it. So you should be able to send theExchangeto 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()
-
onRedelivery
public OnExceptionDefinition onRedelivery(org.apache.camel.Processor processor)
Sets a processor that should be processed before a redelivery attempt. Can be used to change theExchangebefore its being redelivered.
-
onRedeliveryRef
public OnExceptionDefinition onRedeliveryRef(String ref)
Sets a reference to a processor that should be processed before a redelivery attempt. Can be used to change theExchangebefore its being redelivered.- Parameters:
ref- reference to the processor
-
onExceptionOccurred
public OnExceptionDefinition onExceptionOccurred(org.apache.camel.Processor processor)
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.
-
onExceptionOccurredRef
public OnExceptionDefinition onExceptionOccurredRef(String ref)
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.- Parameters:
ref- reference to the processor
-
getOutputs
public List<ProcessorDefinition<?>> getOutputs()
- Overrides:
getOutputsin classOutputDefinition<OnExceptionDefinition>
-
setOutputs
public void setOutputs(List<ProcessorDefinition<?>> outputs)
- Overrides:
setOutputsin classOutputDefinition<OnExceptionDefinition>
-
setExceptions
public void setExceptions(List<String> exceptions)
A set of exceptions to react upon.
-
getRedeliveryPolicyType
public RedeliveryPolicyDefinition getRedeliveryPolicyType()
-
setRedeliveryPolicyType
public void setRedeliveryPolicyType(RedeliveryPolicyDefinition redeliveryPolicyType)
Used for configuring redelivery options
-
getRedeliveryPolicyRef
public String getRedeliveryPolicyRef()
-
setRedeliveryPolicyRef
public void setRedeliveryPolicyRef(String redeliveryPolicyRef)
-
getHandledPolicy
public org.apache.camel.Predicate getHandledPolicy()
-
setHandled
public void setHandled(ExpressionSubElementDefinition handled)
-
getContinued
public ExpressionSubElementDefinition getContinued()
-
setContinued
public void setContinued(ExpressionSubElementDefinition continued)
-
getHandled
public ExpressionSubElementDefinition getHandled()
-
setHandledPolicy
public void setHandledPolicy(org.apache.camel.Predicate handledPolicy)
-
getContinuedPolicy
public org.apache.camel.Predicate getContinuedPolicy()
-
setContinuedPolicy
public void setContinuedPolicy(org.apache.camel.Predicate continuedPolicy)
-
getOnWhen
public WhenDefinition getOnWhen()
-
setOnWhen
public void setOnWhen(WhenDefinition onWhen)
-
getRetryWhile
public ExpressionSubElementDefinition getRetryWhile()
-
setRetryWhile
public void setRetryWhile(ExpressionSubElementDefinition retryWhile)
-
getRetryWhilePolicy
public org.apache.camel.Predicate getRetryWhilePolicy()
-
setRetryWhilePolicy
public void setRetryWhilePolicy(org.apache.camel.Predicate retryWhilePolicy)
-
getOnRedelivery
public org.apache.camel.Processor getOnRedelivery()
-
setOnRedelivery
public void setOnRedelivery(org.apache.camel.Processor onRedelivery)
-
getOnRedeliveryRef
public String getOnRedeliveryRef()
-
setOnRedeliveryRef
public void setOnRedeliveryRef(String onRedeliveryRef)
-
getOnExceptionOccurred
public org.apache.camel.Processor getOnExceptionOccurred()
-
setOnExceptionOccurred
public void setOnExceptionOccurred(org.apache.camel.Processor onExceptionOccurred)
-
getOnExceptionOccurredRef
public String getOnExceptionOccurredRef()
-
setOnExceptionOccurredRef
public void setOnExceptionOccurredRef(String onExceptionOccurredRef)
-
getUseOriginalMessage
public String getUseOriginalMessage()
-
setUseOriginalMessage
public void setUseOriginalMessage(String useOriginalMessage)
-
getUseOriginalBody
public String getUseOriginalBody()
-
setUseOriginalBody
public void setUseOriginalBody(String useOriginalBody)
-
getOrCreateRedeliveryPolicy
protected RedeliveryPolicyDefinition getOrCreateRedeliveryPolicy()
-
-