如何在Spring Boot执行器中实现自定义终结点以保持健康

时间:2019-09-12 23:28:36

标签: java endpoint spring-boot-actuator health-monitoring

我将如何在SpringBoot中实现自定义端点来实现以下目标:

http://localhost:8080/actuator/health/custom

其中“ custom”是我要实现的扩展健康的端点。

1 个答案:

答案 0 :(得分:0)

该URL用于公开应用程序的运行状况检查,如果您遇到这种情况,则只需包括执行器的依赖项:

<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency>

,您可以查看应用程序的状态。

如果您需要更具体的信息,请仅配置依赖性,如您所见here .

您还可以覆盖运行状况检查的行为,但是该依赖项具有很多功能。