总线端点
Spring Cloud Bus 提供了三个端点,/actuator/busrefresh,/actutator/busshutdown和/actuator/busenv对应于 Spring Cloud Commons 中的单个执行器端点,/actuator/refresh,/actuator/shutdown和/actuator/env分别。
总线刷新终结点
这/actuator/busrefreshendpoint 会清除RefreshScope缓存和重新绑定@ConfigurationProperties.请参阅刷新范围文档,了解
更多信息。
要公开/actuator/busrefresh端点,您需要将以下配置添加到
应用:
management.endpoints.web.exposure.include=busrefresh
总线环境端点
这/actuator/busenv端点使用指定的
跨多个实例的键/值对。
要公开/actuator/busenv端点,您需要将以下配置添加到
应用:
management.endpoints.web.exposure.include=busenv
这/actuator/busenv端点接受POST请求,具有以下形状:
{
"name": "key1",
"value": "value1"
}
总线关闭端点
这/actuator/busshutdown正常关闭应用程序。
要公开/actuator/busshutdown端点,您需要将以下配置添加到
应用:
management.endpoints.web.exposure.include=busshutdown
您可以向busshutdownendpoint 通过发出POST请求。
如果您想针对特定应用程序,可以向POST请求/busshutdown和可选的
指定总线 ID:
$ curl -X POST http://localhost:8080/actuator/busshutdown
您还可以通过指定总线 ID 来定位特定的应用程序实例:
$ curl -X POST http://localhost:8080/actuator/busshutdown/busid:123