Class RedeliveryErrorHandler.RedeliveryTask

java.lang.Object
org.apache.camel.processor.errorhandler.RedeliveryErrorHandler.RedeliveryTask
All Implemented Interfaces:
Runnable, PooledExchangeTask
Enclosing class:
RedeliveryErrorHandler

protected class RedeliveryErrorHandler.RedeliveryTask extends Object implements PooledExchangeTask, Runnable
Task to perform calling the processor and handling redelivery if it fails (more advanced than ProcessTask)
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    deliverToFailureProcessor(org.apache.camel.Processor processor, boolean isDeadLetterChannel, org.apache.camel.Exchange exchange)
    All redelivery attempts failed so move the exchange to the dead letter queue
    protected void
    Gives an optional configured redelivery processor a chance to process before the Exchange will be redelivered.
    protected void
     
    protected boolean
     
    protected boolean
     
    protected void
    Gives an optional configured OnExceptionOccurred processor a chance to process just after an exception was thrown while processing the Exchange.
    void
    prepare(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback)
    Prepares the task for the given exchange and its callback
    protected void
    prepareExchangeAfterFailure(org.apache.camel.Exchange exchange, boolean isDeadLetterChannel, boolean shouldHandle, boolean shouldContinue)
     
    protected void
    prepareExchangeForContinue(org.apache.camel.Exchange exchange, boolean isDeadLetterChannel)
     
    protected void
     
    protected void
     
    void
    Resets the task after its done and can be reused for another exchange.
    void
    run()
    Processing and redelivery logic.
    boolean
    Method for sleeping during redelivery attempts.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RedeliveryTask

      public RedeliveryTask()
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • prepare

      public void prepare(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback)
      Description copied from interface: PooledExchangeTask
      Prepares the task for the given exchange and its callback
      Specified by:
      prepare in interface PooledExchangeTask
      Parameters:
      exchange - the exchange
      callback - the callback
    • reset

      public void reset()
      Description copied from interface: PooledExchangeTask
      Resets the task after its done and can be reused for another exchange.
      Specified by:
      reset in interface PooledExchangeTask
    • run

      public void run()
      Processing and redelivery logic.
      Specified by:
      run in interface Runnable
    • isRunAllowed

      protected boolean isRunAllowed()
    • isRedeliveryAllowed

      protected boolean isRedeliveryAllowed()
    • redeliver

      protected void redeliver()
    • prepareExchangeForContinue

      protected void prepareExchangeForContinue(org.apache.camel.Exchange exchange, boolean isDeadLetterChannel)
    • prepareExchangeForRedelivery

      protected void prepareExchangeForRedelivery()
    • handleException

      protected void handleException()
    • onExceptionOccurred

      protected void onExceptionOccurred()
      Gives an optional configured OnExceptionOccurred processor a chance to process just after an exception was thrown while processing the Exchange. This allows to execute the processor at the same time the exception was thrown.
    • deliverToOnRedeliveryProcessor

      protected void deliverToOnRedeliveryProcessor()
      Gives an optional configured redelivery processor a chance to process before the Exchange will be redelivered. This can be used to alter the Exchange.
    • deliverToFailureProcessor

      protected void deliverToFailureProcessor(org.apache.camel.Processor processor, boolean isDeadLetterChannel, org.apache.camel.Exchange exchange)
      All redelivery attempts failed so move the exchange to the dead letter queue
    • prepareExchangeAfterFailure

      protected void prepareExchangeAfterFailure(org.apache.camel.Exchange exchange, boolean isDeadLetterChannel, boolean shouldHandle, boolean shouldContinue)
    • sleep

      public boolean sleep() throws InterruptedException
      Method for sleeping during redelivery attempts.

      This task is for the synchronous blocking. If using async delayed then a scheduled thread pool is used for sleeping and trigger redeliveries.

      Throws:
      InterruptedException