@Override public void handleError(Throwable t) { log(t); if (!this.causeChainContainsARADRE(t) && this.exceptionStrategy.isFatal(t)) { if (this.discardFatalsWithXDeath && t instanceof ListenerExecutionFailedException) { Message failed = ((ListenerExecutionFailedException) t).getFailedMessage(); if (failed != null) { List<Map<String, ?>> xDeath = failed.getMessageProperties().getXDeathHeader(); if (xDeath != null && xDeath.size() > 0) { this.logger.error("x-death header detected on a message with a fatal exception; " + "perhaps requeued from a DLQ? - discarding: " + failed); throw new ImmediateAcknowledgeAmqpException("Fatal and x-death present"); } } } throw new AmqpRejectAndDontRequeueException("Error Handler converted exception to fatal", t); } }
@Override public void handleError(Throwable t) { log(t); if (!this.causeChainContainsARADRE(t) && this.exceptionStrategy.isFatal(t)) { if (this.discardFatalsWithXDeath && t instanceof ListenerExecutionFailedException) { Message failed = ((ListenerExecutionFailedException) t).getFailedMessage(); if (failed != null) { List<Map<String, ?>> xDeath = failed.getMessageProperties().getXDeathHeader(); if (xDeath != null && xDeath.size() > 0) { this.logger.error("x-death header detected on a message with a fatal exception; " + "perhaps requeued from a DLQ? - discarding: " + failed); throw new ImmediateAcknowledgeAmqpException("Fatal and x-death present"); } } } throw new AmqpRejectAndDontRequeueException("Error Handler converted exception to fatal", t); } }