怎么能知道绑定是活着的



我使用spring-boot 2.1.x和spring-cloud Greenwich。SR5我想预先检查这个绑定是否有效,但我不知道该怎么办。

如何知道源或汇连接的绑定

帮我一把。感谢

您可以通过此处解释的可视化和控制功能来查看绑定状态以及管理其生命周期。

基本上通过将这些依赖项添加到您的POM

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

并设置以下属性

management.endpoints.web.exposure.include=bindings

您可以通过http://<host>:<port>/actuator/bindingsurl访问绑定。

最新更新