我有一个正在运行的 Springboot 应用程序,它提供 URLhttp://localhost:8081/topics
并按预期返回 JSON 响应。
我添加了执行器依赖项
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
<scope>test</scope>
</dependency>
如建议的
但当我击中http://localhost:8081/health
它没有给出预期的结果。它说
{
"timestamp": 1497952368055,
"status": 404,
"error": "Not Found",
"message": "No message available",
"path": "/health"
}
Spring引导版本是1.5.4.RELEASE。还有Java 1.8
我还需要进行哪些额外设置?
在 Spring Boot 2.0.0 中你必须使用/actuator/health
并在应用程序属性文件添加以下行:
management.endpoint.health.show-details=always
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)