I had a test and depend on 'org.springframework.boot:2.7.10', 'spring-boot-starter-actuator', 'spring-boot-starter-amqp '. At the test, I haven't created any instance about RabbitMQ, just added the dependency that spring-boot-starter-amqp in the pom file. When the application gets the request of URI 'actuator/health', the instance of RabbitHealthIndicator doing doHealthCheck, then creating Rabbit connection. At some times, it isn't what we expected.

Comment From: bclozel

Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use the issue tracker only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.