Rabbit health check failed, org.springframework.amqp.AmqpIOException_ java.io.IOException

1. Problem description

The Spring Boot project has added an Amqp dependency, but has not yet used the message queue, and because Acuator monitoring is turned on to expose all endpoints (because amqp is exposed, it is also necessary to check amqp), resulting in this error when the project is started (although it does not affect , but obsessive-compulsive disorder looks uncomfortable)

Insert image description here

2.3 solutions

  • Method 1: Comment out the temporarily unused amqp dependencies in pom or build.gradle
// implementation group: 'org.springframework.boot', name: 'spring-boot-starter-amqp', version: '2.1.4.RELEASE' 
  • Method 2: Exclude the automatic assembly of Amqp on the startup class
@SpringBootApplication(exclude = {RabbitAutoConfiguration.class})
public class BossApplication {
    public static void main(String[] args) {
        SpringApplication.run(BossApplication.class, args);
    }
} 
  • Method 3: Close the exposed endpoint Amqp information
management.health.rabbit = false 

or

management:
  health:
    enabled: true
    show-details: always #Always show details。Can display status information of each module
    rabbit:
      enabled: false