您的位置:首頁技術文章
文章詳情頁

springboot 如何禁用某項健康檢查

瀏覽:72日期:2023-02-23 17:16:19
springboot 禁用某項健康檢查

management.health.mail.enabledmanagement.health.mongo.enabledmanagement.health.redis.enabledmanagement.health.solr.enabledmanagement.health.elasticsearch.enabled

http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#production-ready-customizing-endpoints

springboot加es健康檢查問題

代碼自定義了健康檢查路徑/actuator/health

但是實際請求的時候走不到自己的代碼里

會經過filter攔截掉,攔截之后會經過調用es的健康檢查失敗,而返回503

解決辦法:

application.yaml里

management endpoints exposure exclude: health

排除health,走自己寫的健康檢查接口

以上為個人經驗,希望能給大家一個參考,也希望大家多多支持好吧啦網。

標簽: Spring
相關文章:
国产综合久久一区二区三区