Class RejectAndDontRequeueRecoverer
- java.lang.Object
-
- org.springframework.amqp.rabbit.retry.RejectAndDontRequeueRecoverer
-
- All Implemented Interfaces:
MessageRecoverer
public class RejectAndDontRequeueRecoverer extends 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
-
-
Constructor Summary
Constructors Constructor Description RejectAndDontRequeueRecoverer()
Construct an instance with the default exception message.RejectAndDontRequeueRecoverer(String message)
Construct an instance with the provided exception message.RejectAndDontRequeueRecoverer(Supplier<String> messageSupplier)
Construct an instance with the provided exception message supplier.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
recover(Message message, Throwable cause)
Callback for message that was consumed but failed all retry attempts.
-
-
-
Field Detail
-
logger
protected final Log logger
-
-
Constructor Detail
-
RejectAndDontRequeueRecoverer
public RejectAndDontRequeueRecoverer()
Construct an instance with the default exception message.
-
RejectAndDontRequeueRecoverer
public RejectAndDontRequeueRecoverer(String message)
Construct an instance with the provided exception message.- Parameters:
message
- the message.- Since:
- 2.3.7
-
-
Method Detail
-
recover
public void recover(Message message, Throwable cause)
Description copied from interface:MessageRecoverer
Callback for message that was consumed but failed all retry attempts.- Specified by:
recover
in interfaceMessageRecoverer
- Parameters:
message
- the message to recovercause
- the cause of the error
-
-