Class DeadLetterChannelDefinition
- java.lang.Object
-
- org.apache.camel.model.IdentifiedType
-
- org.apache.camel.model.errorhandler.DefaultErrorHandlerDefinition
-
- org.apache.camel.model.errorhandler.DeadLetterChannelDefinition
-
- All Implemented Interfaces:
org.apache.camel.ErrorHandlerFactory
- Direct Known Subclasses:
DeadLetterChannelBuilder
@Metadata(label="configuration,error") public class DeadLetterChannelDefinition extends DefaultErrorHandlerDefinition
Error handler with dead letter queue.
-
-
Constructor Summary
Constructors Constructor Description DeadLetterChannelDefinition()
DeadLetterChannelDefinition(String deadLetterUri)
DeadLetterChannelDefinition(org.apache.camel.Endpoint deadLetterUri)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.camel.ErrorHandlerFactory
cloneBuilder()
protected void
cloneBuilder(DeadLetterChannelDefinition other)
protected RedeliveryPolicyDefinition
createRedeliveryPolicy()
DefaultErrorHandlerDefinition
deadLetterHandleNewException(boolean handleNewException)
Whether the dead letter channel should handle (and ignore) any new exception that may been thrown during sending the message to the dead letter endpoint.DeadLetterChannelDefinition
deadLetterUri(String deadLetterUri)
The dead letter endpoint uri for the Dead Letter error handler.String
getDeadLetterHandleNewException()
String
getDeadLetterUri()
void
setDeadLetterHandleNewException(String deadLetterHandleNewException)
Whether the dead letter channel should handle (and ignore) any new exception that may been thrown during sending the message to the dead letter endpoint.void
setDeadLetterUri(String deadLetterUri)
The dead letter endpoint uri for the Dead Letter error handler.boolean
supportTransacted()
-
Methods inherited from class org.apache.camel.model.errorhandler.DefaultErrorHandlerDefinition
allowRedeliveryWhileStopping, asyncDelayedRedelivery, backOffMultiplier, cloneBuilder, collisionAvoidancePercent, delayPattern, disableRedelivery, exchangeFormatterRef, executorService, executorServiceRef, getExecutorServiceBean, getExecutorServiceRef, getLevel, getLoggerBean, getLoggerRef, getLogName, getOnExceptionOccurredProcessor, getOnExceptionOccurredRef, getOnPrepareFailureProcessor, getOnPrepareFailureRef, getOnRedeliveryProcessor, getOnRedeliveryRef, getRedeliveryPolicy, getRedeliveryPolicyRef, getRetryWhilePredicate, getRetryWhileRef, getUseOriginalBody, getUseOriginalMessage, hasRedeliveryPolicy, log, log, log, logExhausted, logExhaustedMessageBody, logExhaustedMessageHistory, logger, loggingLevel, loggingLevel, logHandled, logNewException, logRetryAttempted, logRetryStackTrace, logStackTrace, maximumRedeliveries, maximumRedeliveryDelay, onExceptionOccurred, onExceptionOccurredRef, onPrepareFailure, onPrepareFailureRef, onRedelivery, onRedeliveryRef, redeliveryDelay, redeliveryPolicyRef, retriesExhaustedLogLevel, retryAttemptedLogInterval, retryAttemptedLogLevel, retryWhile, retryWhileRef, setExecutorServiceBean, setExecutorServiceRef, setLevel, setLoggerBean, setLoggerRef, setLogName, setOnExceptionOccurredProcessor, setOnExceptionOccurredRef, setOnPrepareFailureProcessor, setOnPrepareFailureRef, setOnRedeliveryProcessor, setOnRedeliveryRef, setRedeliveryPolicy, setRedeliveryPolicyRef, setRetryWhilePredicate, setRetryWhileRef, setUseOriginalBody, setUseOriginalMessage, useCollisionAvoidance, useExponentialBackOff, useOriginalBody, useOriginalMessage
-
Methods inherited from class org.apache.camel.model.IdentifiedType
getId, setId
-
-
-
-
Constructor Detail
-
DeadLetterChannelDefinition
public DeadLetterChannelDefinition()
-
DeadLetterChannelDefinition
public DeadLetterChannelDefinition(String deadLetterUri)
-
DeadLetterChannelDefinition
public DeadLetterChannelDefinition(org.apache.camel.Endpoint deadLetterUri)
-
-
Method Detail
-
createRedeliveryPolicy
protected RedeliveryPolicyDefinition createRedeliveryPolicy()
- Overrides:
createRedeliveryPolicy
in classDefaultErrorHandlerDefinition
-
getDeadLetterUri
public String getDeadLetterUri()
-
setDeadLetterUri
public void setDeadLetterUri(String deadLetterUri)
The dead letter endpoint uri for the Dead Letter error handler.
-
getDeadLetterHandleNewException
public String getDeadLetterHandleNewException()
-
setDeadLetterHandleNewException
public void setDeadLetterHandleNewException(String deadLetterHandleNewException)
Whether the dead letter channel should handle (and ignore) any new exception that may been thrown during sending the message to the dead letter endpoint. The default value is true which means any such kind of exception is handled and ignored. Set this to false to let the exception be propagated back on theExchange
. This can be used in situations where you use transactions, and want to use Camel's dead letter channel to deal with exceptions during routing, but if the dead letter channel itself fails because of a new exception being thrown, then by setting this to false the new exceptions is propagated back and set on theExchange
, which allows the transaction to detect the exception, and rollback.
-
supportTransacted
public boolean supportTransacted()
- Specified by:
supportTransacted
in interfaceorg.apache.camel.ErrorHandlerFactory
- Overrides:
supportTransacted
in classDefaultErrorHandlerDefinition
-
cloneBuilder
public org.apache.camel.ErrorHandlerFactory cloneBuilder()
- Specified by:
cloneBuilder
in interfaceorg.apache.camel.ErrorHandlerFactory
- Overrides:
cloneBuilder
in classDefaultErrorHandlerDefinition
-
cloneBuilder
protected void cloneBuilder(DeadLetterChannelDefinition other)
-
deadLetterUri
public DeadLetterChannelDefinition deadLetterUri(String deadLetterUri)
The dead letter endpoint uri for the Dead Letter error handler.
-
deadLetterHandleNewException
public DefaultErrorHandlerDefinition deadLetterHandleNewException(boolean handleNewException)
Whether the dead letter channel should handle (and ignore) any new exception that may been thrown during sending the message to the dead letter endpoint. The default value is true which means any such kind of exception is handled and ignored. Set this to false to let the exception be propagated back on theExchange
. This can be used in situations where you use transactions, and want to use Camel's dead letter channel to deal with exceptions during routing, but if the dead letter channel itself fails because of a new exception being thrown, then by setting this to false the new exceptions is propagated back and set on theExchange
, which allows the transaction to detect the exception, and rollback.- Parameters:
handleNewException
- true to handle (and ignore), false to catch and propagated the exception on theExchange
- Returns:
- the builder
-
-