|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.camel.model.OptionalIdentifiedDefinition<Type> org.apache.camel.model.ProcessorDefinition<ProcessorDefinition> org.apache.camel.model.OnExceptionDefinition
public class OnExceptionDefinition
Represents an XML <onException/> element
Field Summary |
---|
Fields inherited from class org.apache.camel.model.ProcessorDefinition |
---|
log |
Constructor Summary | |
---|---|
OnExceptionDefinition()
|
|
OnExceptionDefinition(Class exceptionType)
|
|
OnExceptionDefinition(List<Class> exceptionClasses)
|
Method Summary | |
---|---|
void |
addRoutes(RouteContext routeContext,
Collection<Route> routes)
|
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 |
protected List<Class> |
createExceptionClasses()
|
CatchProcessor |
createProcessor(RouteContext routeContext)
|
RedeliveryPolicy |
createRedeliveryPolicy(CamelContext context,
RedeliveryPolicy parentPolicy)
Allows an exception handler to create a new redelivery policy for this exception type |
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 |
getRetryUntil()
|
Predicate |
getRetryUntilPolicy()
|
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. |
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 cathing certain exceptions and handling them. |
OnExceptionDefinition |
onRedelivery(Processor processor)
Sets a processor that should be processed before a redelivey 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)
Sets the delay |
OnExceptionDefinition |
redeliveryDelay(long delay)
Sets the fixed delay between redeliveries |
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 |
retryUntil(Expression until)
Sets the retry until expression. |
OnExceptionDefinition |
retryUntil(Predicate until)
Sets the retry until predicate. |
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 |
setRetryUntil(ExpressionSubElementDefinition retryUntil)
|
void |
setRetryUntilPolicy(Predicate retryUntilPolicy)
|
void |
setUseOriginalMessagePolicy(Boolean useOriginalMessagePolicy)
|
String |
toString()
|
OnExceptionDefinition |
useCollisionAvoidance()
Turn on collision avoidance. |
OnExceptionDefinition |
useExponentialBackOff()
Turn on exponential backk off |
OnExceptionDefinition |
useOriginalBody()
Will use the original input body when an Exchange is moved to the dead letter queue. |
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition |
---|
description, getDescription, 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<ProcessorDefinition>
public String toString()
toString
in class Object
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<ProcessorDefinition>
Exception
public CatchProcessor createProcessor(RouteContext routeContext) throws Exception
createProcessor
in class ProcessorDefinition<ProcessorDefinition>
Exception
public OnExceptionDefinition onException(Class exceptionType)
ProcessorDefinition
onException
in class ProcessorDefinition<ProcessorDefinition>
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 onWhen(Predicate predicate)
predicate
- predicate that determines true or false
public ExpressionClause<OnExceptionDefinition> onWhen()
public OnExceptionDefinition retryUntil(Predicate until)
until
- predicate that determines when to stop retrying
public OnExceptionDefinition retryUntil(Expression until)
until
- expression that determines when to stop retrying
public OnExceptionDefinition redeliverDelay(long delay)
delay
- the redeliver 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 retriesExhaustedLogLevel(LoggingLevel retriesExhaustedLogLevel)
retriesExhaustedLogLevel
- the logging level
public OnExceptionDefinition retryAttemptedLogLevel(LoggingLevel retryAttemptedLogLevel)
retryAttemptedLogLevel
- the logging level
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 useOriginalBody()
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<ProcessorDefinition>
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 getHandled()
public void setHandledPolicy(Predicate handledPolicy)
public WhenDefinition getOnWhen()
public void setOnWhen(WhenDefinition onWhen)
public ExpressionSubElementDefinition getRetryUntil()
public void setRetryUntil(ExpressionSubElementDefinition retryUntil)
public Predicate getRetryUntilPolicy()
public void setRetryUntilPolicy(Predicate retryUntilPolicy)
public Processor getOnRedelivery()
public void setOnRedelivery(Processor onRedelivery)
public String getOnRedeliveryRef()
public void setOnRedeliveryRef(String onRedeliveryRef)
public Boolean getUseOriginalMessagePolicy()
public void setUseOriginalMessagePolicy(Boolean useOriginalMessagePolicy)
protected RedeliveryPolicyDefinition getOrCreateRedeliveryPolicy()
protected List<Class> createExceptionClasses()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |