|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.camel.model.OptionalIdentifiedDefinition org.apache.camel.model.ProcessorDefinition<OnExceptionDefinition> org.apache.camel.model.OnExceptionDefinition
public class OnExceptionDefinition
Represents an XML <onException/> element
Field Summary |
---|
Fields inherited from class org.apache.camel.model.ProcessorDefinition |
---|
errorHandlerBuilder, errorHandlerRef, inheritErrorHandler, log |
Constructor Summary | |
---|---|
OnExceptionDefinition()
|
|
OnExceptionDefinition(Class exceptionType)
|
|
OnExceptionDefinition(List<Class> exceptionClasses)
|
Method Summary | |
---|---|
void |
addRoutes(RouteContext routeContext,
Collection<Route> routes)
|
OnExceptionDefinition |
asyncDelayedRedelivery()
Allow synchronous delayed redelivery. |
OnExceptionDefinition |
backOffMultiplier(double backOffMultiplier)
Sets the back off multiplier |
OnExceptionDefinition |
collisionAvoidanceFactor(double collisionAvoidanceFactor)
Sets the collision avoidance factor |
OnExceptionDefinition |
collisionAvoidancePercent(double collisionAvoidancePercent)
Sets the collision avoidance percentage |
OnExceptionDefinition |
continued(boolean continued)
Sets whether the exchange should handle and continue routing from the point of failure. |
OnExceptionDefinition |
continued(Expression continued)
Sets whether the exchange should be marked as handled or not. |
OnExceptionDefinition |
continued(Predicate continued)
Sets whether the exchange should be marked as handled or not. |
protected List<Class> |
createExceptionClasses()
|
CatchProcessor |
createProcessor(RouteContext routeContext)
Override this in definition class and implement logic to create the processor based on the definition model. |
RedeliveryPolicy |
createRedeliveryPolicy(CamelContext context,
RedeliveryPolicy parentPolicy)
Allows an exception handler to create a new redelivery policy for this exception type |
OnExceptionDefinition |
delayPattern(String delayPattern)
Sets the delay pattern with delay intervals. |
ExpressionSubElementDefinition |
getContinued()
|
Predicate |
getContinuedPolicy()
|
Processor |
getErrorHandler()
|
List<Class> |
getExceptionClasses()
|
List<String> |
getExceptions()
|
ExpressionSubElementDefinition |
getHandled()
|
Predicate |
getHandledPolicy()
|
Processor |
getOnRedelivery()
|
String |
getOnRedeliveryRef()
|
WhenDefinition |
getOnWhen()
|
protected RedeliveryPolicyDefinition |
getOrCreateRedeliveryPolicy()
|
List<ProcessorDefinition> |
getOutputs()
|
RedeliveryPolicyDefinition |
getRedeliveryPolicy()
|
ExpressionSubElementDefinition |
getRetryWhile()
|
Predicate |
getRetryWhilePolicy()
|
String |
getShortName()
Returns a short name for this node which can be useful for ID generation or referring to related resources like images |
Boolean |
getUseOriginalMessagePolicy()
|
OnExceptionDefinition |
handled(boolean handled)
Sets whether the exchange should be marked as handled or not. |
OnExceptionDefinition |
handled(Expression handled)
Sets whether the exchange should be marked as handled or not. |
OnExceptionDefinition |
handled(Predicate handled)
Sets whether the exchange should be marked as handled or not. |
boolean |
isAbstract()
Whether this model is abstract or not. |
boolean |
isAsyncDelayedRedelivery()
|
boolean |
isUseOriginalMessage()
|
OnExceptionDefinition |
logContinued(boolean logContinued)
Sets whether to log errors even if its continued |
OnExceptionDefinition |
logExhausted(boolean logExhausted)
Sets whether to log exhausted exceptions |
OnExceptionDefinition |
logHandled(boolean logHandled)
Sets whether to log errors even if its handled |
OnExceptionDefinition |
logRetryAttempted(boolean logRetryAttempted)
Sets whether to log retry attempts |
OnExceptionDefinition |
logRetryStackTrace(boolean logRetryStackTrace)
Sets whether to log stacktrace for failed redelivery attempts |
OnExceptionDefinition |
logStackTrace(boolean logStackTrace)
Sets whether to log stacktrace for failed messages. |
OnExceptionDefinition |
maximumRedeliveries(int maximumRedeliveries)
Sets the maximum redeliveries 5 = default value 0 = no redeliveries -1 = redeliver forever |
OnExceptionDefinition |
maximumRedeliveryDelay(long maximumRedeliveryDelay)
Sets the maximum delay between redelivery |
OnExceptionDefinition |
onException(Class exceptionType)
Exception clause for catching certain exceptions and handling them. |
OnExceptionDefinition |
onRedelivery(Processor processor)
Sets a processor that should be processed before a redelivery attempt. |
ExpressionClause<OnExceptionDefinition> |
onWhen()
Creates an expression to configure an additional predicate that should be true before the onException is triggered. |
OnExceptionDefinition |
onWhen(Predicate predicate)
Sets an additional predicate that should be true before the onException is triggered. |
OnExceptionDefinition |
redeliverDelay(long delay)
Deprecated. |
OnExceptionDefinition |
redeliveryDelay(long delay)
Sets the initial redelivery delay |
OnExceptionDefinition |
redeliveryPolicyRef(String redeliveryPolicyRef)
Sets a reference to a RedeliveryPolicy to lookup in the Registry to be used. |
OnExceptionDefinition |
retriesExhaustedLogLevel(LoggingLevel retriesExhaustedLogLevel)
Sets the logging level to use when retries has exhausted |
OnExceptionDefinition |
retryAttemptedLogLevel(LoggingLevel retryAttemptedLogLevel)
Sets the logging level to use for logging retry attempts |
OnExceptionDefinition |
retryWhile(Expression retryWhile)
Sets the retry while expression. |
OnExceptionDefinition |
retryWhile(Predicate retryWhile)
Sets the retry while predicate. |
void |
setContinued(ExpressionSubElementDefinition continued)
|
void |
setContinuedPolicy(Predicate continuedPolicy)
|
void |
setExceptionClasses(List<Class> exceptionClasses)
|
void |
setExceptions(List<String> exceptions)
|
void |
setHandled(ExpressionSubElementDefinition handled)
|
void |
setHandledPolicy(Predicate handledPolicy)
|
void |
setOnRedelivery(Processor onRedelivery)
|
void |
setOnRedeliveryRef(String onRedeliveryRef)
|
void |
setOnWhen(WhenDefinition onWhen)
|
void |
setOutputs(List<ProcessorDefinition> outputs)
|
void |
setRedeliveryPolicy(RedeliveryPolicyDefinition redeliveryPolicy)
|
void |
setRetryWhile(ExpressionSubElementDefinition retryWhile)
|
void |
setRetryWhilePolicy(Predicate retryWhilePolicy)
|
void |
setUseOriginalMessagePolicy(Boolean useOriginalMessagePolicy)
|
String |
toString()
|
OnExceptionDefinition |
useCollisionAvoidance()
Turn on collision avoidance. |
OnExceptionDefinition |
useExponentialBackOff()
Turn on exponential backk off |
OnExceptionDefinition |
useOriginalBody()
Deprecated. this method will be removed in Camel 3.0, please use useOriginalMessage() |
OnExceptionDefinition |
useOriginalMessage()
Will use the original input message when an Exchange is moved to the dead letter queue. |
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition |
---|
description, getDescription, getDescriptionText, getId, hasCustomIdAssigned, idOrCreate, setDescription, setId |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OnExceptionDefinition()
public OnExceptionDefinition(List<Class> exceptionClasses)
public OnExceptionDefinition(Class exceptionType)
Method Detail |
---|
public String getShortName()
OptionalIdentifiedDefinition
getShortName
in class OptionalIdentifiedDefinition
public String toString()
toString
in class Object
public boolean isAbstract()
ProcessorDefinition
isAbstract
in class ProcessorDefinition<OnExceptionDefinition>
public RedeliveryPolicy createRedeliveryPolicy(CamelContext context, RedeliveryPolicy parentPolicy)
context
- the camel contextparentPolicy
- the current redelivery policy
public void addRoutes(RouteContext routeContext, Collection<Route> routes) throws Exception
addRoutes
in class ProcessorDefinition<OnExceptionDefinition>
Exception
public CatchProcessor createProcessor(RouteContext routeContext) throws Exception
ProcessorDefinition
createProcessor
in class ProcessorDefinition<OnExceptionDefinition>
Exception
public OnExceptionDefinition onException(Class exceptionType)
ProcessorDefinition
onException
in class ProcessorDefinition<OnExceptionDefinition>
exceptionType
- the exception to catch
public OnExceptionDefinition handled(boolean handled)
handled
- handled or not
public OnExceptionDefinition handled(Predicate handled)
handled
- predicate that determines true or false
public OnExceptionDefinition handled(Expression handled)
handled
- expression that determines true or false
public OnExceptionDefinition continued(boolean continued)
continued
- continued or not
public OnExceptionDefinition continued(Predicate continued)
continued
- predicate that determines true or false
public OnExceptionDefinition continued(Expression continued)
continued
- expression that determines true or false
public OnExceptionDefinition onWhen(Predicate predicate)
predicate
- predicate that determines true or false
public ExpressionClause<OnExceptionDefinition> onWhen()
public OnExceptionDefinition retryWhile(Predicate retryWhile)
retryWhile
- predicate that determines when to stop retrying
public OnExceptionDefinition retryWhile(Expression retryWhile)
retryWhile
- expression that determines when to stop retrying
@Deprecated public OnExceptionDefinition redeliverDelay(long delay)
delay
- the initial redelivery delay
public OnExceptionDefinition backOffMultiplier(double backOffMultiplier)
backOffMultiplier
- the back off multiplier
public OnExceptionDefinition collisionAvoidanceFactor(double collisionAvoidanceFactor)
collisionAvoidanceFactor
- the factor
public OnExceptionDefinition collisionAvoidancePercent(double collisionAvoidancePercent)
collisionAvoidancePercent
- the percentage
public OnExceptionDefinition redeliveryDelay(long delay)
delay
- delay in millis
public OnExceptionDefinition asyncDelayedRedelivery()
RedeliveryPolicy.setAsyncDelayedRedelivery(boolean)
public OnExceptionDefinition retriesExhaustedLogLevel(LoggingLevel retriesExhaustedLogLevel)
retriesExhaustedLogLevel
- the logging level
public OnExceptionDefinition retryAttemptedLogLevel(LoggingLevel retryAttemptedLogLevel)
retryAttemptedLogLevel
- the logging level
public OnExceptionDefinition logStackTrace(boolean logStackTrace)
public OnExceptionDefinition logRetryStackTrace(boolean logRetryStackTrace)
public OnExceptionDefinition logHandled(boolean logHandled)
public OnExceptionDefinition logContinued(boolean logContinued)
public OnExceptionDefinition logRetryAttempted(boolean logRetryAttempted)
public OnExceptionDefinition logExhausted(boolean logExhausted)
public OnExceptionDefinition maximumRedeliveries(int maximumRedeliveries)
maximumRedeliveries
- the value
public OnExceptionDefinition useCollisionAvoidance()
public OnExceptionDefinition useExponentialBackOff()
public OnExceptionDefinition maximumRedeliveryDelay(long maximumRedeliveryDelay)
maximumRedeliveryDelay
- the delay in millis
public OnExceptionDefinition redeliveryPolicyRef(String redeliveryPolicyRef)
RedeliveryPolicy
to lookup in the Registry
to be used.
redeliveryPolicyRef
- reference to use for lookup
public OnExceptionDefinition delayPattern(String delayPattern)
delayPattern
- the delay pattern
@Deprecated public OnExceptionDefinition useOriginalBody()
useOriginalMessage()
useOriginalMessage()
public OnExceptionDefinition useOriginalMessage()
Exchange
is moved to the dead letter queue.
Notice: this only applies when all redeliveries attempt have failed and the Exchange
is doomed for failure.
Exchange
IN body we use the original IN body instead. This allows
you to store the original input in the dead letter queue instead of the inprogress snapshot of the IN body.
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 the Exchange
again as the IN body
is the same as when Camel received it. So you should be able to send the Exchange
to the same input.
By default this feature is off.
public OnExceptionDefinition onRedelivery(Processor processor)
Exchange
before its being redelivered.
public List<ProcessorDefinition> getOutputs()
getOutputs
in class ProcessorDefinition<OnExceptionDefinition>
public void setOutputs(List<ProcessorDefinition> outputs)
public List<Class> getExceptionClasses()
public void setExceptionClasses(List<Class> exceptionClasses)
public List<String> getExceptions()
public void setExceptions(List<String> exceptions)
public Processor getErrorHandler()
public RedeliveryPolicyDefinition getRedeliveryPolicy()
public void setRedeliveryPolicy(RedeliveryPolicyDefinition redeliveryPolicy)
public Predicate getHandledPolicy()
public void setHandled(ExpressionSubElementDefinition handled)
public ExpressionSubElementDefinition getContinued()
public void setContinued(ExpressionSubElementDefinition continued)
public ExpressionSubElementDefinition getHandled()
public void setHandledPolicy(Predicate handledPolicy)
public Predicate getContinuedPolicy()
public void setContinuedPolicy(Predicate continuedPolicy)
public WhenDefinition getOnWhen()
public void setOnWhen(WhenDefinition onWhen)
public ExpressionSubElementDefinition getRetryWhile()
public void setRetryWhile(ExpressionSubElementDefinition retryWhile)
public Predicate getRetryWhilePolicy()
public void setRetryWhilePolicy(Predicate retryWhilePolicy)
public Processor getOnRedelivery()
public void setOnRedelivery(Processor onRedelivery)
public String getOnRedeliveryRef()
public void setOnRedeliveryRef(String onRedeliveryRef)
public Boolean getUseOriginalMessagePolicy()
public boolean isUseOriginalMessage()
public void setUseOriginalMessagePolicy(Boolean useOriginalMessagePolicy)
public boolean isAsyncDelayedRedelivery()
protected RedeliveryPolicyDefinition getOrCreateRedeliveryPolicy()
protected List<Class> createExceptionClasses()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |