org.apache.camel.processor
Class DeadLetterChannel

java.lang.Object
  extended by org.apache.camel.impl.ServiceSupport
      extended by org.apache.camel.processor.ErrorHandlerSupport
          extended by org.apache.camel.processor.DeadLetterChannel
All Implemented Interfaces:
Processor, ErrorHandler, Service

public class DeadLetterChannel
extends ErrorHandlerSupport
implements Processor

Implements a Dead Letter Channel after attempting to redeliver the message using the RedeliveryPolicy

Version:
$Revision: 774230 $

Field Summary
 
Fields inherited from class org.apache.camel.processor.ErrorHandlerSupport
log
 
Constructor Summary
DeadLetterChannel(Processor output, Processor deadLetter, String deadLetterUri, Processor redeliveryProcessor, RedeliveryPolicy redeliveryPolicy, Logger logger, ExceptionPolicyStrategy exceptionPolicyStrategy, Predicate handledPolicy, boolean useOriginalBodyPolicy)
          Creates the dead letter channel.
 
Method Summary
protected  void doStart()
           
protected  void doStop()
           
 Processor getDeadLetter()
          Returns the dead letter that message exchanges will be sent to if the redelivery attempts fail
 Logger getLogger()
           
 Processor getOutput()
          Returns the output processor
 RedeliveryPolicy getRedeliveryPolicy()
           
 void process(Exchange exchange)
          Processes the message exchange
protected  void processErrorHandler(Exchange exchange, org.apache.camel.processor.DeadLetterChannel.RedeliveryData data)
          Processes the exchange decorated with this dead letter channel.
 boolean supportTransacted()
          Whether this error handler supports transacted exchanges or not.
 String toString()
           
 
Methods inherited from class org.apache.camel.processor.ErrorHandlerSupport
addExceptionPolicy, createDefaultExceptionPolicyStrategy, customProcessorForException, getExceptionPolicy, setExceptionPolicy
 
Methods inherited from class org.apache.camel.impl.ServiceSupport
addChildService, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, removeChildService, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeadLetterChannel

public DeadLetterChannel(Processor output,
                         Processor deadLetter,
                         String deadLetterUri,
                         Processor redeliveryProcessor,
                         RedeliveryPolicy redeliveryPolicy,
                         Logger logger,
                         ExceptionPolicyStrategy exceptionPolicyStrategy,
                         Predicate handledPolicy,
                         boolean useOriginalBodyPolicy)
Creates the dead letter channel.

Parameters:
output - outer processor that should use this dead letter channel
deadLetter - the failure processor to send failed exchanges to
deadLetterUri - an optional uri for logging purpose
redeliveryProcessor - an optional processor to run before redelivert attempt
redeliveryPolicy - policy for redelivery
logger - logger to use for logging failures and redelivery attempts
exceptionPolicyStrategy - strategy for onException handling
handledPolicy - policy for handling failed exception that are moved to the dead letter queue
useOriginalBodyPolicy - should the original IN body be moved to the dead letter queue or the current exchange IN body?
Method Detail

toString

public String toString()
Overrides:
toString in class Object

supportTransacted

public boolean supportTransacted()
Description copied from class: ErrorHandlerSupport
Whether this error handler supports transacted exchanges or not.

Specified by:
supportTransacted in class ErrorHandlerSupport

process

public void process(Exchange exchange)
             throws Exception
Description copied from interface: Processor
Processes the message exchange

Specified by:
process in interface Processor
Parameters:
exchange - the message exchange
Throws:
Exception - if an internal processing error has occurred.

processErrorHandler

protected void processErrorHandler(Exchange exchange,
                                   org.apache.camel.processor.DeadLetterChannel.RedeliveryData data)
Processes the exchange decorated with this dead letter channel.


getOutput

public Processor getOutput()
Returns the output processor


getDeadLetter

public Processor getDeadLetter()
Returns the dead letter that message exchanges will be sent to if the redelivery attempts fail


getRedeliveryPolicy

public RedeliveryPolicy getRedeliveryPolicy()

getLogger

public Logger getLogger()

doStart

protected void doStart()
                throws Exception
Specified by:
doStart in class ServiceSupport
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Specified by:
doStop in class ServiceSupport
Throws:
Exception


Copyright © 2009 Apache Software Foundation. All Rights Reserved.