Class RejectAndDontRequeueRecoverer

  • All Implemented Interfaces:
    MessageRecoverer

    public class RejectAndDontRequeueRecoverer
    extends java.lang.Object
    implements MessageRecoverer
    MessageRecover that causes the listener container to reject the message without requeuing. This enables failed messages to be sent to a Dead Letter Exchange/Queue, if the broker is so configured.
    Since:
    1.1.2
    Author:
    Gary Russell
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Log logger  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void recover​(Message message, java.lang.Throwable cause)
      Callback for message that was consumed but failed all retry attempts.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        protected final Log logger
    • Constructor Detail

      • RejectAndDontRequeueRecoverer

        public RejectAndDontRequeueRecoverer()
        Construct an instance with the default exception message.
      • RejectAndDontRequeueRecoverer

        public RejectAndDontRequeueRecoverer​(java.lang.String message)
        Construct an instance with the provided exception message.
        Parameters:
        message - the message.
        Since:
        2.3.7
      • RejectAndDontRequeueRecoverer

        public RejectAndDontRequeueRecoverer​(java.util.function.Supplier<java.lang.String> messageSupplier)
        Construct an instance with the provided exception message supplier.
        Parameters:
        messageSupplier - the message supplier.
        Since:
        2.3.7
    • Method Detail

      • recover

        public void recover​(Message message,
                            java.lang.Throwable cause)
        Description copied from interface: MessageRecoverer
        Callback for message that was consumed but failed all retry attempts.
        Specified by:
        recover in interface MessageRecoverer
        Parameters:
        message - the message to recover
        cause - the cause of the error