|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.camel.builder.ErrorHandlerBuilderSupport
org.apache.camel.builder.DeadLetterChannelBuilder
public class DeadLetterChannelBuilder
A builder of a Dead Letter Channel
Constructor Summary | |
---|---|
DeadLetterChannelBuilder()
Creates a default DeadLetterChannel with a default endpoint |
|
DeadLetterChannelBuilder(Endpoint deadLetter)
Creates a DeadLetterChannel using the given endpoint |
|
DeadLetterChannelBuilder(String uri)
Creates a DeadLetterChannel using the given endpoint |
Method Summary | |
---|---|
DeadLetterChannelBuilder |
backOffMultiplier(double backOffMultiplier)
|
DeadLetterChannelBuilder |
collisionAvoidancePercent(short collisionAvoidancePercent)
|
Processor |
createErrorHandler(RouteContext routeContext,
Processor processor)
Creates the error handler interceptor |
DeadLetterChannelBuilder |
delay(long delay)
|
DeadLetterChannelBuilder |
delayPattern(String delayPattern)
|
DeadLetterChannelBuilder |
disableRedelivery()
|
DeadLetterChannelBuilder |
exceptionPolicyStrategy(ExceptionPolicyStrategy exceptionPolicyStrategy)
Sets the exception policy to use |
Endpoint |
getDeadLetter()
|
String |
getDeadLetterUri()
|
ExceptionPolicyStrategy |
getExceptionPolicyStrategy()
Sets the exception policy strategy to use for resolving the OnExceptionDefinition
to use for a given thrown exception |
Processor |
getFailureProcessor()
|
Predicate |
getHandledPolicy()
|
Logger |
getLogger()
|
Processor |
getOnRedelivery()
|
RedeliveryPolicy |
getRedeliveryPolicy()
|
DeadLetterChannelBuilder |
handled(boolean handled)
Sets whether the exchange should be marked as handled or not. |
DeadLetterChannelBuilder |
handled(Expression handled)
Sets whether the exchange should be marked as handled or not. |
DeadLetterChannelBuilder |
handled(Predicate handled)
Sets whether the exchange should be marked as handled or not. |
boolean |
isUseOriginalBody()
|
DeadLetterChannelBuilder |
log(Class log)
Sets the log used for caught exceptions |
DeadLetterChannelBuilder |
log(org.apache.commons.logging.Log log)
Sets the log used for caught exceptions |
DeadLetterChannelBuilder |
log(String log)
Sets the log used for caught exceptions |
DeadLetterChannelBuilder |
logger(Logger logger)
Sets the logger used for caught exceptions |
DeadLetterChannelBuilder |
loggingLevel(LoggingLevel level)
Sets the logging level of exceptions caught |
DeadLetterChannelBuilder |
logStackTrace(boolean logStackTrace)
|
DeadLetterChannelBuilder |
maximumRedeliveries(int maximumRedeliveries)
|
DeadLetterChannelBuilder |
maximumRedeliveryDelay(long maximumRedeliveryDelay)
|
DeadLetterChannelBuilder |
onRedelivery(Processor processor)
Sets a processor that should be processed before a redelivey attempt. |
DeadLetterChannelBuilder |
retriesExhaustedLogLevel(LoggingLevel retriesExhaustedLogLevel)
|
DeadLetterChannelBuilder |
retryAttemptedLogLevel(LoggingLevel retryAttemptedLogLevel)
|
void |
setDeadLetter(Endpoint deadLetter)
|
void |
setDeadLetterUri(String deadLetterUri)
|
void |
setExceptionPolicyStrategy(ExceptionPolicyStrategy exceptionPolicyStrategy)
Sets the exception policy strategy to use for resolving the OnExceptionDefinition
to use for a given thrown exception |
void |
setFailureProcessor(Processor failureProcessor)
|
void |
setHandled(boolean handled)
Sets the handled using a boolean and thus easier to use for Spring XML configuration as well |
void |
setHandledPolicy(Predicate handled)
|
void |
setLogger(Logger logger)
|
void |
setOnRedelivery(Processor onRedelivery)
|
void |
setRedeliveryPolicy(RedeliveryPolicy redeliveryPolicy)
Sets the redelivery policy |
void |
setUseOriginalBody(boolean useOriginalBody)
|
boolean |
supportTransacted()
Whether this error handler supports transacted exchanges. |
String |
toString()
|
DeadLetterChannelBuilder |
useCollisionAvoidance()
|
DeadLetterChannelBuilder |
useExponentialBackOff()
|
DeadLetterChannelBuilder |
useOriginalBody()
Will use the original input body when an Exchange is moved to the dead letter queue. |
Methods inherited from class org.apache.camel.builder.ErrorHandlerBuilderSupport |
---|
addErrorHandlers, configure, getErrorHandlers, setErrorHandlers |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DeadLetterChannelBuilder()
public DeadLetterChannelBuilder(Endpoint deadLetter)
deadLetter
- the dead letter queuepublic DeadLetterChannelBuilder(String uri)
uri
- the dead letter queueMethod Detail |
---|
public Processor createErrorHandler(RouteContext routeContext, Processor processor) throws Exception
ErrorHandlerBuilder
routeContext
- the route contextprocessor
- the outer processor
Exception
- is thrown if the error handler could not be createdpublic boolean supportTransacted()
ErrorHandlerBuilder
public DeadLetterChannelBuilder backOffMultiplier(double backOffMultiplier)
public DeadLetterChannelBuilder collisionAvoidancePercent(short collisionAvoidancePercent)
public DeadLetterChannelBuilder delay(long delay)
public DeadLetterChannelBuilder delayPattern(String delayPattern)
public DeadLetterChannelBuilder maximumRedeliveries(int maximumRedeliveries)
public DeadLetterChannelBuilder disableRedelivery()
public DeadLetterChannelBuilder maximumRedeliveryDelay(long maximumRedeliveryDelay)
public DeadLetterChannelBuilder useCollisionAvoidance()
public DeadLetterChannelBuilder useExponentialBackOff()
public DeadLetterChannelBuilder retriesExhaustedLogLevel(LoggingLevel retriesExhaustedLogLevel)
public DeadLetterChannelBuilder retryAttemptedLogLevel(LoggingLevel retryAttemptedLogLevel)
public DeadLetterChannelBuilder logStackTrace(boolean logStackTrace)
public DeadLetterChannelBuilder handled(boolean handled)
handled
- handled or not
public DeadLetterChannelBuilder handled(Predicate handled)
handled
- predicate that determines true or false
public DeadLetterChannelBuilder handled(Expression handled)
handled
- expression that determines true or false
public DeadLetterChannelBuilder logger(Logger logger)
logger
- the logger
public DeadLetterChannelBuilder loggingLevel(LoggingLevel level)
level
- the logging level
public DeadLetterChannelBuilder log(org.apache.commons.logging.Log log)
log
- the logger
public DeadLetterChannelBuilder log(String log)
log
- the log name
public DeadLetterChannelBuilder log(Class log)
log
- the log class
public DeadLetterChannelBuilder exceptionPolicyStrategy(ExceptionPolicyStrategy exceptionPolicyStrategy)
exceptionPolicyStrategy
in class ErrorHandlerBuilderSupport
public DeadLetterChannelBuilder onRedelivery(Processor processor)
Exchange
before its being redelivered.
public DeadLetterChannelBuilder 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 Processor getFailureProcessor()
public void setFailureProcessor(Processor failureProcessor)
public String getDeadLetterUri()
public void setDeadLetterUri(String deadLetterUri)
public Endpoint getDeadLetter()
public void setDeadLetter(Endpoint deadLetter)
public RedeliveryPolicy getRedeliveryPolicy()
public void setRedeliveryPolicy(RedeliveryPolicy redeliveryPolicy)
public Logger getLogger()
public void setLogger(Logger logger)
public ExceptionPolicyStrategy getExceptionPolicyStrategy()
OnExceptionDefinition
to use for a given thrown exception
getExceptionPolicyStrategy
in interface ErrorHandlerBuilder
getExceptionPolicyStrategy
in class ErrorHandlerBuilderSupport
public void setExceptionPolicyStrategy(ExceptionPolicyStrategy exceptionPolicyStrategy)
ErrorHandlerBuilder
OnExceptionDefinition
to use for a given thrown exception
setExceptionPolicyStrategy
in interface ErrorHandlerBuilder
setExceptionPolicyStrategy
in class ErrorHandlerBuilderSupport
exceptionPolicyStrategy
- the exception policy strategypublic Processor getOnRedelivery()
public void setOnRedelivery(Processor onRedelivery)
public Predicate getHandledPolicy()
public void setHandledPolicy(Predicate handled)
public void setHandled(boolean handled)
public boolean isUseOriginalBody()
public void setUseOriginalBody(boolean useOriginalBody)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |