弹簧启动运行状况未显示详细信息(包含详细信息)
2022-09-01 04:51:23
我写了一个实现HealthIndicator的类,覆盖了health-method。我回来了Health.down().withDetail("SupportServiceStatus", "UP").build();
这应该使我的 -endpoint 返回:health
{
"status":"UP",
"applicationHealth": {
"status":"UP"
}
}
相反,它只是返回(运行状况,没有详细信息):
{
"status":"UP",
}
Javacode(稍微简化):
@Component
public class ApplicationHealth implements HealthIndicator {
@Override
public Health health() {
return check();
}
private Health check() {
return Health.up().withDetail("SupportServiceStatus", supportServiceStatusCode).build();
}
}