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
Implements a Dead Letter Channel after attempting to
redeliver the message using the
RedeliveryPolicy-
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, useOriginalMessagePolicyFields inherited from class org.apache.camel.processor.errorhandler.ErrorHandlerSupport
DEFAULT_EXCHANGE_FORMATTER, exceptionPolicies, exceptionPolicyFields inherited from class org.apache.camel.support.ChildServiceSupport
childServicesFields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING -
Constructor Summary
ConstructorsConstructorDescriptionDeadLetterChannel(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
Modifier and TypeMethodDescriptionorg.apache.camel.spi.ErrorHandlerclone(org.apache.camel.Processor output) Clones the current error handler and changes the outputbooleanWhether this error handler handles exhausted errors by moving the exchange to a dead letter channel.protected booleantoString()Methods inherited from class org.apache.camel.processor.errorhandler.RedeliveryErrorHandler
changeOutput, defensiveCopyExchangeIfNeeded, determineIfRedeliveryIsEnabled, determineRedeliveryDelay, doShutdown, doStart, getDeadLetter, getDeadLetterUri, getDefaultHandledPredicate, getLogger, getOutput, getRedeliveryPolicy, hasNext, isDeadLetterHandleNewException, isDone, isUseOriginalBodyPolicy, isUseOriginalMessagePolicy, next, prepareShutdown, process, process, processAsync, supportTransactedMethods inherited from class org.apache.camel.processor.errorhandler.ErrorHandlerSupport
addErrorHandler, addExceptionPolicy, getExceptionPolicyMethods inherited from class org.apache.camel.support.ChildServiceSupport
addChildService, removeChildService, shutdown, start, stopMethods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doStop, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.camel.Service
build, close, initMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
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- theScheduledExecutorServiceto be used for redelivery thread pool. Can be null.onPrepareProcessor- a customProcessorto prepare theExchangebefore handled by the failure processor / dead letter channel.onExceptionOccurredProcessor- a customProcessorto process theExchangejust after an exception was thrown.
-
-
Method Details
-
clone
public org.apache.camel.spi.ErrorHandler clone(org.apache.camel.Processor output) Description copied from class:ErrorHandlerSupportClones the current error handler and changes the output- Specified by:
clonein classErrorHandlerSupport
-
toString
-
isRunAllowedOnPreparingShutdown
protected boolean isRunAllowedOnPreparingShutdown()- Overrides:
isRunAllowedOnPreparingShutdownin classRedeliveryErrorHandler
-
isDeadLetterChannel
public boolean isDeadLetterChannel()Description copied from class:ErrorHandlerSupportWhether this error handler handles exhausted errors by moving the exchange to a dead letter channel.- Overrides:
isDeadLetterChannelin classErrorHandlerSupport
-