Class RetryErrorHandler

java.lang.Object
org.springframework.amqp.rabbit.listener.ConditionalRejectingErrorHandler
io.jaconi.spring.rabbitmq.retry.RetryErrorHandler
All Implemented Interfaces:
org.springframework.util.ErrorHandler

@Component("retryErrorHandler") public class RetryErrorHandler extends org.springframework.amqp.rabbit.listener.ConditionalRejectingErrorHandler
Custom error handling for RabbitMQ. By default, Spring AMQP retries most exceptions by immediately requeuing the causing message. This error handler rejects any messages causing an exception in the listener. If messages should be retried, the listener code can throw a RetryMessagesException. The messages in the RetryMessagesException are retried as configured in the RetryProperties.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.springframework.amqp.rabbit.listener.ConditionalRejectingErrorHandler

    org.springframework.amqp.rabbit.listener.ConditionalRejectingErrorHandler.DefaultExceptionStrategy
  • Field Summary

    Fields inherited from class org.springframework.amqp.rabbit.listener.ConditionalRejectingErrorHandler

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
    RetryErrorHandler(org.springframework.amqp.core.AmqpTemplate amqpTemplate)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     

    Methods inherited from class org.springframework.amqp.rabbit.listener.ConditionalRejectingErrorHandler

    causeChainContainsARADRE, getExceptionStrategy, handleDiscarded, isDiscardFatalsWithXDeath, isRejectManual, log, setDiscardFatalsWithXDeath, setRejectManual

    Methods inherited from class java.lang.Object

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

    • RetryErrorHandler

      public RetryErrorHandler(org.springframework.amqp.core.AmqpTemplate amqpTemplate)
  • Method Details

    • handleError

      public void handleError(@NonNull Throwable t)
      Specified by:
      handleError in interface org.springframework.util.ErrorHandler
      Overrides:
      handleError in class org.springframework.amqp.rabbit.listener.ConditionalRejectingErrorHandler