|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.camel.impl.ServiceSupport org.apache.camel.processor.ErrorHandlerSupport org.apache.camel.processor.RedeliveryErrorHandler
public abstract class RedeliveryErrorHandler
Base redeliverable error handler that also suppors a final dead letter queue in case all redelivery attempts fail.
This implementation should contain all the error handling logic and the sub classes should only configure it according to what they support.
Nested Class Summary | |
---|---|
protected class |
RedeliveryErrorHandler.RedeliveryData
|
Field Summary | |
---|---|
protected Processor |
deadLetter
|
protected String |
deadLetterUri
|
protected Predicate |
handledPolicy
|
protected Logger |
logger
|
protected Processor |
output
|
protected RedeliveryPolicy |
redeliveryPolicy
|
protected Processor |
redeliveryProcessor
|
protected boolean |
useOriginalMessagePolicy
|
Fields inherited from class org.apache.camel.processor.ErrorHandlerSupport |
---|
log |
Constructor Summary | |
---|---|
RedeliveryErrorHandler(Processor output,
Logger logger,
Processor redeliveryProcessor,
RedeliveryPolicy redeliveryPolicy,
Predicate handledPolicy,
Processor deadLetter,
String deadLetterUri,
boolean useOriginalMessagePolicy)
|
Method Summary | |
---|---|
protected void |
deliverToFailureProcessor(Processor processor,
Exchange exchange,
RedeliveryErrorHandler.RedeliveryData data)
All redelivery attempts failed so move the exchange to the dead letter queue |
protected void |
deliverToRedeliveryProcessor(Exchange exchange,
RedeliveryErrorHandler.RedeliveryData data)
Gives an optional configure redelivery processor a chance to process before the Exchange will be redelivered. |
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()
|
protected void |
handleException(Exchange exchange,
RedeliveryErrorHandler.RedeliveryData data)
|
protected boolean |
isDone(Exchange exchange)
Strategy to determine if the exchange is done so we can continue |
protected void |
prepareExchangeAfterFailure(Exchange exchange,
RedeliveryErrorHandler.RedeliveryData data)
|
protected void |
prepareExchangeForRedelivery(Exchange exchange)
|
void |
process(Exchange exchange)
Processes the message exchange |
protected void |
processErrorHandler(Exchange exchange,
RedeliveryErrorHandler.RedeliveryData data)
Processes the exchange decorated with this dead letter channel. |
protected void |
processExchange(Exchange exchange)
Strategy to process the given exchange to the destinated output. |
protected boolean |
shouldHandleException(Exchange exchange)
Strategy whether the exchange has an exception that we should try to handle. |
boolean |
supportTransacted()
Whether this error handler supports transacted exchanges or not. |
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, toString, wait, wait, wait |
Field Detail |
---|
protected final Processor deadLetter
protected final String deadLetterUri
protected final Processor output
protected final Processor redeliveryProcessor
protected final RedeliveryPolicy redeliveryPolicy
protected final Predicate handledPolicy
protected final Logger logger
protected final boolean useOriginalMessagePolicy
Constructor Detail |
---|
public RedeliveryErrorHandler(Processor output, Logger logger, Processor redeliveryProcessor, RedeliveryPolicy redeliveryPolicy, Predicate handledPolicy, Processor deadLetter, String deadLetterUri, boolean useOriginalMessagePolicy)
Method Detail |
---|
public boolean supportTransacted()
ErrorHandlerSupport
supportTransacted
in class ErrorHandlerSupport
public void process(Exchange exchange) throws Exception
Processor
process
in interface Processor
exchange
- the message exchange
Exception
- if an internal processing error has occurred.protected void processErrorHandler(Exchange exchange, RedeliveryErrorHandler.RedeliveryData data) throws Exception
Exception
protected boolean shouldHandleException(Exchange exchange)
protected void processExchange(Exchange exchange) throws Exception
Exception
protected boolean isDone(Exchange exchange) throws Exception
Exception
public Processor getOutput()
public Processor getDeadLetter()
public RedeliveryPolicy getRedeliveryPolicy()
public Logger getLogger()
protected void prepareExchangeForRedelivery(Exchange exchange)
protected void handleException(Exchange exchange, RedeliveryErrorHandler.RedeliveryData data)
protected void deliverToRedeliveryProcessor(Exchange exchange, RedeliveryErrorHandler.RedeliveryData data)
protected void deliverToFailureProcessor(Processor processor, Exchange exchange, RedeliveryErrorHandler.RedeliveryData data)
protected void prepareExchangeAfterFailure(Exchange exchange, RedeliveryErrorHandler.RedeliveryData data)
protected void doStart() throws Exception
doStart
in class ServiceSupport
Exception
protected void doStop() throws Exception
doStop
in class ServiceSupport
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |