return newMessageIdentifier.isNew(message);
}
}
});
final MessageRecoverer messageRecoverer = getMessageRecoverer();
retryInterceptor.setRecoverer(new MethodInvocationRecoverer<Void>() {
public Void recover(Object[] args, Throwable cause) {
Message message = (Message) args[1];
if (messageRecoverer == null) {
logger.warn("Message dropped on recovery: " + message, cause);
} else {
messageRecoverer.recover(message, cause);
}
// This is actually a normal outcome. It means the recovery was successful, but we don't want to consume
// any more messages until the acks and commits are sent for this (problematic) message...
throw new ImmediateAcknowledgeAmqpException("Recovered message forces ack (if ack mode requires it): "
+ message, cause);