@Override public boolean isFatal(Throwable t) { Throwable cause = t.getCause(); while (cause instanceof MessagingException && !(cause instanceof org.springframework.messaging.converter.MessageConversionException) && !(cause instanceof MethodArgumentResolutionException)) { cause = cause.getCause(); } if (t instanceof ListenerExecutionFailedException && isCauseFatal(cause)) { if (this.logger.isWarnEnabled()) { this.logger.warn( "Fatal message conversion error; message rejected; " + "it will be dropped or routed to a dead letter exchange, if so configured: " + ((ListenerExecutionFailedException) t).getFailedMessage()); } return true; } return false; }
@Override public boolean isFatal(Throwable t) { Throwable cause = t.getCause(); while (cause instanceof MessagingException && !(cause instanceof org.springframework.messaging.converter.MessageConversionException) && !(cause instanceof MethodArgumentResolutionException)) { cause = cause.getCause(); } if (t instanceof ListenerExecutionFailedException && isCauseFatal(cause)) { if (this.logger.isWarnEnabled()) { this.logger.warn( "Fatal message conversion error; message rejected; " + "it will be dropped or routed to a dead letter exchange, if so configured: " + ((ListenerExecutionFailedException) t).getFailedMessage()); } return true; } return false; }
private boolean isCauseFatal(Throwable cause) { return cause instanceof MessageConversionException // NOSONAR boolean complexity || cause instanceof org.springframework.messaging.converter.MessageConversionException || cause instanceof MethodArgumentResolutionException || cause instanceof NoSuchMethodException || cause instanceof ClassCastException || isUserCauseFatal(cause); }
private boolean isCauseFatal(Throwable cause) { return cause instanceof MessageConversionException // NOSONAR boolean complexity || cause instanceof org.springframework.messaging.converter.MessageConversionException || cause instanceof MethodArgumentResolutionException || cause instanceof NoSuchMethodException || cause instanceof ClassCastException || isUserCauseFatal(cause); }
/** * Create a handler with the {@link ConditionalRejectingErrorHandler.DefaultExceptionStrategy}. */ public ConditionalRejectingErrorHandler() { this.exceptionStrategy = new DefaultExceptionStrategy(); }
/** * Create a handler with the {@link ConditionalRejectingErrorHandler.DefaultExceptionStrategy}. */ public ConditionalRejectingErrorHandler() { this.exceptionStrategy = new DefaultExceptionStrategy(); }
@Override public boolean isFatal(Throwable t) { if (t instanceof ListenerExecutionFailedException) { ListenerExecutionFailedException lefe = (ListenerExecutionFailedException) t; logger.error("Failed to process inbound message from queue " + lefe.getFailedMessage().getMessageProperties().getConsumerQueue() + "; failed message: " + lefe.getFailedMessage(), t); } return super.isFatal(t); }