我想用自定义 json 响应覆盖 Spring boot Health 端点。我试过了,public class MyHealth implements HealthIndicator
但那是返回一些用 myHealth 对象包装的值
这实际上是我在实施后得到的
{
"status": "UP",
"myHealth": {
"name": "Integration Service",
"version": "1.0",
"_links": {
"self": {
"href": "http://localhost:8083/health"
}
}
}
}
但这实际上是我想要的输出
{
"name": "Integration Service",
"version": "1.0",
"status": "UP",
"_links": {
"self": {
"href": "http://localhost:8083/health"
}
}
}