spring-boot - springboot从1.5.x升级到2.3.x后如何保留旧的执行器端点

标签 spring-boot spring-boot-actuator

我正在尝试将 springboot 应用程序从 1.5.x 迁移到 2.3.x。已经走了很长的路了。据我了解,现在运行状况检查的端点是/actuator/health,而不是旧版本中的/health。

在 openshift 上,配置在进行就绪性探测时仍然引用/health 端点。我想知道如何仍然使用/health 端点而不是/actuator/health。 springboot 2 是否提供了任何钩子(Hook)来覆盖默认端点。如有任何帮助,我们将不胜感激。

最佳答案

您可以像这样更改执行器的路径:

management.endpoints.web.base-path=/

那么你仍然有/health 而不是/actuator/health

但请注意路径名称不要冲突。

关于spring-boot - springboot从1.5.x升级到2.3.x后如何保留旧的执行器端点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66602414/

相关文章:

java - 如何划分大的 Http 响应

java - Swagger2 > 记录一个 SpringBoot MvcEndpoint

Spring Boot 2.0 Actuator git 属性未添加到/info

java - Spring Boot 使用调度程序关闭

java - 带有 spring boot 的 Swagger 在某些机器上构建时有效,但在其他机器上无效

java - 当 management.port 与服务器端口不同时,如何调用 OncePerRequestFilter?

java - 我可以在 Spring boot 自定义 validator 中自动连接一个存储库吗

java - 实行预约系统

spring-boot - Spring Boot 执行器 "/health"不工作

spring-boot - Spring Boot 2 Actuator Httptrace 主体为空