我寫一個類實現HealthIndicator,覆蓋醫療方法。我回到Health.down().withDetail("SupportServiceStatus", "UP").build();
彈簧引導健康沒有顯示細節(withDetail資訊)
這應該使我health
-endpoint回報:
{
"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();
}
}
沒有彈簧啓動的新版本 – cahen
更新的答案。需要管理標誌在1.4.2-RELEASE – olahell
對於> 1.4.1我覺得工作1.5.1 – Jontia