diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/RabbitUtils.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/RabbitUtils.java index 768f5e66b8..ee259816e9 100644 --- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/RabbitUtils.java +++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/RabbitUtils.java @@ -354,8 +354,8 @@ public static boolean isExchangeDeclarationFailure(Exception e) { } else { Method shutdownReason = sig.getReason(); - return shutdownReason instanceof AMQP.Connection.Close closeReason - && AMQP.COMMAND_INVALID == closeReason.getReplyCode() + return shutdownReason instanceof AMQP.Channel.Close closeReason + && AMQP.PRECONDITION_FAILED == closeReason.getReplyCode() && closeReason.getClassId() == EXCHANGE_CLASS_ID_40 && closeReason.getMethodId() == DECLARE_METHOD_ID_10; }