【问题标题】:How to retain old actuator endpoint after springboot upgrade from 1.5.x to 2.3.xSpring Boot 从 1.5.x 升级到 2.3.x 后如何保留旧的执行器端点
【发布时间】:2021-03-12 15:05:07
【问题描述】:

我正在尝试将 springboot 应用程序从 1.5.x 迁移到 2.3.x。已经走了很长一段路。我知道现在进行健康检查的端点是 /actuator/health 而不是旧版本中的 /health。

在 openshift 上,配置在进行就绪探测时仍然引用 /health 端点。我想知道如何仍然使用 /health 端点而不是 /actuator/health。 springboot 2是否有任何钩子来覆盖默认端点。任何帮助表示赞赏。

【问题讨论】:

    标签: spring-boot spring-boot-actuator


    【解决方案1】:

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

    management.endpoints.web.base-path=/
    

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

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

    【讨论】:

    • 你先生,太棒了!!
    猜你喜欢
    • 1970-01-01
    • 2018-12-20
    • 1970-01-01
    • 2022-01-22
    • 2022-08-24
    • 2015-12-14
    • 2016-09-08
    • 1970-01-01
    • 2018-10-07
    相关资源
    最近更新 更多