spring-boot - Resilience4J for Springboot - registerHealthIndicator: true 有什么用
问题描述
在 Resilience4J for spring boot 中 registerHealthIndicator: true 的用途是什么?
文档https://resilience4j.readme.io/docs/getting-started-3#health-endpoint说如果我们在 application.yml 中进行如下配置,我们可以看到健康端点中断路器的状态。
management.health.circuitbreakers.enabled: true
resilience4j.circuitbreaker:
configs:
default:
registerHealthIndicator: true
当我尝试执行器健康端点 - http://localhost:8080/actuator/health 时,我只看到一个状态: {"status":"UP"} 。其中没有关于断路器的详细信息。
是否有任何我缺少健康端点的配置?
注意:我可以在其他端点中查看断路器详细信息,例如 - http://localhost:8080/actuator/circuitbreakerevents - http://localhost:8080/actuator/circuitbreakers
解决方案
为了在/health
端点中查看详细信息,您需要更改属性management.endpoint.health.show-details
配置。它定义了何时显示完整的健康细节,默认情况下它的值为never
. 您需要always
按如下方式实际配置它:
management.endpoint.health.show-details = always
推荐阅读
- angular - 前端 maven 插件无法执行目标
- java - 重构 Java For 循环代码以使用 Java 8 流 API
- neo4j - 在 Neo4j 中运行 CQL 文件
- c++ - Unicode 字符到 CEdit
- reactjs - 我面临反应浏览器路由器嵌套的问题?
- sql - 如何知道文件是否已在 Windows 中完全写入磁盘。(禁用磁盘写入缓存策略)
- ionic-framework - 在 ionic 4 android version9 中运行服务的问题
- php - 如何根据 SQL 数据库更改 btn-color
- javascript - ng build 有效,但 ng build --prod 抛出错误
- javascript - 如何获取url中的数组值