|
||||||||||
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 |
---|
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 |
backOffMultiplier(String backOffMultiplier)
Sets the back off multiplier (supports property placeholders) |
OnExceptionDefinition |
collisionAvoidanceFactor(double collisionAvoidanceFactor)
Sets the collision avoidance factor |
OnExceptionDefinition |
collisionAvoidanceFactor(String collisionAvoidanceFactor)
Sets the collision avoidance factor (supports property placeholders) |
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(ClassResolver resolver)
|
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. |
protected String |
description()
|
ExpressionSubElementDefinition |
getContinued()
|
Predicate |
getContinuedPolicy()
|
Processor |
getErrorHandler(String routeId)
|
Collection<Processor> |
getErrorHandlers()
|
List<Class> |
getExceptionClasses()
|
List<String> |
getExceptions()
|
ExpressionSubElementDefinition |
getHandled()
|
Predicate |
getHandledPolicy()
|
String |
getLabel()
Returns a label to describe this node such as the expression if some kind of expression node |
Processor |
getOnRedelivery()
|
String |
getOnRedeliveryRef()
|
WhenDefinition |
getOnWhen()
|
protected RedeliveryPolicyDefinition |
getOrCreateRedeliveryPolicy()
|
List<ProcessorDefinition> |
getOutputs()
|
RedeliveryPolicyDefinition |
getRedeliveryPolicy()
|
String |
getRedeliveryPolicyRef()
|
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(CamelContext context)
|
boolean |
isOutputSupported()
|
boolean |
isRouteScoped()
|
boolean |
isUseOriginalMessage()
|
OnExceptionDefinition |
logContinued(boolean logContinued)
Sets whether to log errors even if its continued |
OnExceptionDefinition |
logContinued(String logContinued)
Sets whether to log errors even if its continued (supports property placeholders) |
OnExceptionDefinition |
logExhausted(boolean logExhausted)
Sets whether to log exhausted exceptions |
OnExceptionDefinition |
logExhausted(String logExhausted)
Sets whether to log exhausted exceptions (supports property placeholders) |
OnExceptionDefinition |
logHandled(boolean logHandled)
Sets whether to log errors even if its handled |
OnExceptionDefinition |
logHandled(String logHandled)
Sets whether to log errors even if its handled (supports property placeholders) |
OnExceptionDefinition |
logRetryAttempted(boolean logRetryAttempted)
Sets whether to log retry attempts |
OnExceptionDefinition |
logRetryAttempted(String logRetryAttempted)
Sets whether to log retry attempts (supports property placeholders) |
OnExceptionDefinition |
logRetryStackTrace(boolean logRetryStackTrace)
Sets whether to log stacktrace for failed redelivery attempts |
OnExceptionDefinition |
logRetryStackTrace(String logRetryStackTrace)
Sets whether to log stacktrace for failed redelivery attempts (supports property placeholders) |
OnExceptionDefinition |
logStackTrace(boolean logStackTrace)
Sets whether to log stacktrace for failed messages. |
OnExceptionDefinition |
logStackTrace(String logStackTrace)
Sets whether to log stacktrace for failed messages (supports property placeholders) |
OnExceptionDefinition |
maximumRedeliveries(int maximumRedeliveries)
Sets the maximum redeliveries 5 = default value 0 = no redeliveries -1 = redeliver forever |
OnExceptionDefinition |
maximumRedeliveries(String maximumRedeliveries)
Sets the maximum redeliveries (supports property placeholders) 5 = default value 0 = no redeliveries -1 = redeliver forever |
OnExceptionDefinition |
maximumRedeliveryDelay(long maximumRedeliveryDelay)
Sets the maximum delay between redelivery |
OnExceptionDefinition |
maximumRedeliveryDelay(String maximumRedeliveryDelay)
Sets the maximum delay between redelivery (supports property placeholders) |
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. |
OnExceptionDefinition |
onWhen(Predicate predicate)
Sets an additional predicate that should be true before the onException is triggered. |
OnExceptionDefinition |
redeliverDelay(long delay)
Deprecated. will be removed in the near future. Instead use redeliveryDelay(String) |
OnExceptionDefinition |
redeliveryDelay(long delay)
Sets the initial redelivery delay |
OnExceptionDefinition |
redeliveryDelay(String delay)
Sets the initial redelivery delay (supports property placeholders) |
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)
Deprecated. use retryWhile(org.apache.camel.Predicate) instead.
This method is removed in Camel 2.10 onwards. |
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 |
setRedeliveryPolicyRef(String redeliveryPolicyRef)
|
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. |
protected void |
validateConfiguration()
|
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 boolean isRouteScoped()
public String getShortName()
OptionalIdentifiedDefinition
getShortName
in interface NamedNode
getShortName
in class OptionalIdentifiedDefinition
public String toString()
toString
in class Object
protected String description()
public String getLabel()
ProcessorDefinition
getLabel
in class ProcessorDefinition<OnExceptionDefinition>
public boolean isAbstract()
ProcessorDefinition
isAbstract
in class ProcessorDefinition<OnExceptionDefinition>
public RedeliveryPolicy createRedeliveryPolicy(CamelContext context, RedeliveryPolicy parentPolicy)
context
- the camel contextparentPolicy
- the current redelivery policy, is newer null
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
protected void validateConfiguration()
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 OnExceptionDefinition retryWhile(Predicate retryWhile)
retryWhile
- predicate that determines when to stop retrying
@Deprecated public OnExceptionDefinition retryWhile(Expression retryWhile)
retryWhile(org.apache.camel.Predicate)
instead.
This method is removed in Camel 2.10 onwards.
retryWhile
- expression that determines when to stop retrying
@Deprecated public OnExceptionDefinition redeliverDelay(long delay)
redeliveryDelay(String)
delay
- the initial redelivery delay
public OnExceptionDefinition backOffMultiplier(double backOffMultiplier)
backOffMultiplier
- the back off multiplier
public OnExceptionDefinition backOffMultiplier(String backOffMultiplier)
backOffMultiplier
- the back off multiplier
public OnExceptionDefinition collisionAvoidanceFactor(double collisionAvoidanceFactor)
collisionAvoidanceFactor
- the factor
public OnExceptionDefinition collisionAvoidanceFactor(String collisionAvoidanceFactor)
collisionAvoidanceFactor
- the factor
public OnExceptionDefinition collisionAvoidancePercent(double collisionAvoidancePercent)
collisionAvoidancePercent
- the percentage
public OnExceptionDefinition redeliveryDelay(long delay)
delay
- delay in millis
public OnExceptionDefinition redeliveryDelay(String 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 logStackTrace(String logStackTrace)
public OnExceptionDefinition logRetryStackTrace(boolean logRetryStackTrace)
public OnExceptionDefinition logRetryStackTrace(String logRetryStackTrace)
public OnExceptionDefinition logHandled(boolean logHandled)
public OnExceptionDefinition logHandled(String logHandled)
public OnExceptionDefinition logContinued(boolean logContinued)
public OnExceptionDefinition logContinued(String logContinued)
public OnExceptionDefinition logRetryAttempted(boolean logRetryAttempted)
public OnExceptionDefinition logRetryAttempted(String logRetryAttempted)
public OnExceptionDefinition logExhausted(boolean logExhausted)
public OnExceptionDefinition logExhausted(String logExhausted)
public OnExceptionDefinition maximumRedeliveries(int maximumRedeliveries)
maximumRedeliveries
- the value
public OnExceptionDefinition maximumRedeliveries(String maximumRedeliveries)
maximumRedeliveries
- the value
public OnExceptionDefinition useCollisionAvoidance()
public OnExceptionDefinition useExponentialBackOff()
public OnExceptionDefinition maximumRedeliveryDelay(long maximumRedeliveryDelay)
maximumRedeliveryDelay
- the delay in millis
public OnExceptionDefinition maximumRedeliveryDelay(String 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 boolean isOutputSupported()
isOutputSupported
in class ProcessorDefinition<OnExceptionDefinition>
public List<Class> getExceptionClasses()
public void setExceptionClasses(List<Class> exceptionClasses)
public List<String> getExceptions()
public void setExceptions(List<String> exceptions)
public Processor getErrorHandler(String routeId)
public Collection<Processor> getErrorHandlers()
public RedeliveryPolicyDefinition getRedeliveryPolicy()
public void setRedeliveryPolicy(RedeliveryPolicyDefinition redeliveryPolicy)
public String getRedeliveryPolicyRef()
public void setRedeliveryPolicyRef(String redeliveryPolicyRef)
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 void setUseOriginalMessagePolicy(Boolean useOriginalMessagePolicy)
public boolean isUseOriginalMessage()
public boolean isAsyncDelayedRedelivery(CamelContext context)
protected RedeliveryPolicyDefinition getOrCreateRedeliveryPolicy()
protected List<Class> createExceptionClasses(ClassResolver resolver) throws ClassNotFoundException
ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |