Class DeadLetterChannel
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.ChildServiceSupport
-
- org.apache.camel.processor.errorhandler.ErrorHandlerSupport
-
- org.apache.camel.processor.errorhandler.RedeliveryErrorHandler
-
- org.apache.camel.processor.errorhandler.DeadLetterChannel
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.AsyncProcessor
,org.apache.camel.Navigate<org.apache.camel.Processor>
,org.apache.camel.Processor
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.ErrorHandler
,org.apache.camel.spi.ErrorHandlerRedeliveryCustomizer
,org.apache.camel.spi.ShutdownPrepared
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
public class DeadLetterChannel extends RedeliveryErrorHandler
Implements a Dead Letter Channel after attempting to redeliver the message using theRedeliveryPolicy
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.camel.processor.errorhandler.RedeliveryErrorHandler
RedeliveryErrorHandler.RedeliveryTask, RedeliveryErrorHandler.SimpleTask
-
-
Field Summary
-
Fields inherited from class org.apache.camel.processor.errorhandler.RedeliveryErrorHandler
awaitManager, camelContext, customExchangeFormatter, deadLetter, deadLetterHandleNewException, deadLetterUri, exchangeFormatter, executorService, logger, onExceptionProcessor, onPrepareProcessor, output, outputAsync, preparingShutdown, reactiveExecutor, redeliveryEnabled, redeliveryPolicy, redeliveryProcessor, redeliverySleepCounter, retryWhilePolicy, shutdownStrategy, simpleTask, taskFactory, useOriginalBodyPolicy, useOriginalMessagePolicy
-
Fields inherited from class org.apache.camel.processor.errorhandler.ErrorHandlerSupport
DEFAULT_EXCHANGE_FORMATTER, exceptionPolicies, exceptionPolicy
-
-
Constructor Summary
Constructors Constructor Description DeadLetterChannel(org.apache.camel.CamelContext camelContext, org.apache.camel.Processor output, org.apache.camel.spi.CamelLogger logger, org.apache.camel.Processor redeliveryProcessor, RedeliveryPolicy redeliveryPolicy, org.apache.camel.Processor deadLetter, String deadLetterUri, boolean deadLetterHandleException, boolean useOriginalMessagePolicy, boolean useOriginalBodyPolicy, org.apache.camel.Predicate retryWhile, ScheduledExecutorService executorService, org.apache.camel.Processor onPrepareProcessor, org.apache.camel.Processor onExceptionOccurredProcessor)
Creates the dead letter channel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.camel.spi.ErrorHandler
clone(org.apache.camel.Processor output)
Clones the current error handler and changes the outputboolean
isDeadLetterChannel()
Whether this error handler handles exhausted errors by moving the exchange to a dead letter channel.protected boolean
isRunAllowedOnPreparingShutdown()
String
toString()
-
Methods inherited from class org.apache.camel.processor.errorhandler.RedeliveryErrorHandler
changeOutput, defensiveCopyExchangeIfNeeded, determineIfRedeliveryIsEnabled, determineRedeliveryDelay, doShutdown, doStart, doStop, getDeadLetter, getDeadLetterUri, getDefaultHandledPredicate, getLogger, getOutput, getRedeliveryPolicy, hasNext, isDeadLetterHandleNewException, isDone, isUseOriginalBodyPolicy, isUseOriginalMessagePolicy, next, prepareShutdown, process, process, processAsync, supportTransacted
-
Methods inherited from class org.apache.camel.processor.errorhandler.ErrorHandlerSupport
addErrorHandler, addExceptionPolicy, getExceptionPolicy
-
Methods inherited from class org.apache.camel.support.ChildServiceSupport
addChildService, removeChildService, shutdown, start, stop
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, suspend
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
DeadLetterChannel
public DeadLetterChannel(org.apache.camel.CamelContext camelContext, org.apache.camel.Processor output, org.apache.camel.spi.CamelLogger logger, org.apache.camel.Processor redeliveryProcessor, RedeliveryPolicy redeliveryPolicy, org.apache.camel.Processor deadLetter, String deadLetterUri, boolean deadLetterHandleException, boolean useOriginalMessagePolicy, boolean useOriginalBodyPolicy, org.apache.camel.Predicate retryWhile, ScheduledExecutorService executorService, org.apache.camel.Processor onPrepareProcessor, org.apache.camel.Processor onExceptionOccurredProcessor)
Creates the dead letter channel.- Parameters:
camelContext
- the camel contextoutput
- outer processor that should use this dead letter channellogger
- logger to use for logging failures and redelivery attemptsredeliveryProcessor
- an optional processor to run before redelivery attemptredeliveryPolicy
- policy for redeliverydeadLetter
- the failure processor to send failed exchanges todeadLetterUri
- an optional uri for logging purposedeadLetterHandleException
- whether dead letter channel should handle (and ignore) exceptions which may be thrown during sending the message to the dead letter endpointuseOriginalMessagePolicy
- should the original IN message be moved to the dead letter queue or the current exchange IN message?useOriginalBodyPolicy
- should the original IN message body be moved to the dead letter queue or the current exchange IN message body?retryWhile
- retry whileexecutorService
- theScheduledExecutorService
to be used for redelivery thread pool. Can be null.onPrepareProcessor
- a customProcessor
to prepare theExchange
before handled by the failure processor / dead letter channel.onExceptionOccurredProcessor
- a customProcessor
to process theExchange
just after an exception was thrown.
-
-
Method Detail
-
clone
public org.apache.camel.spi.ErrorHandler clone(org.apache.camel.Processor output)
Description copied from class:ErrorHandlerSupport
Clones the current error handler and changes the output- Specified by:
clone
in classErrorHandlerSupport
-
isRunAllowedOnPreparingShutdown
protected boolean isRunAllowedOnPreparingShutdown()
- Overrides:
isRunAllowedOnPreparingShutdown
in classRedeliveryErrorHandler
-
isDeadLetterChannel
public boolean isDeadLetterChannel()
Description copied from class:ErrorHandlerSupport
Whether this error handler handles exhausted errors by moving the exchange to a dead letter channel.- Overrides:
isDeadLetterChannel
in classErrorHandlerSupport
-
-