springboot禁用某健康检查 springboot 怎样禁用某项健康检查

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

springboot禁用某健康检查 springboot 怎样禁用某项健康检查

食得落   2021-07-23 我要评论
想了解springboot 怎样禁用某项健康检查的相关内容吗,食得落在本文为您仔细讲解springboot禁用某健康检查的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:springboot,禁用某项健康检查,健康检查,下面大家一起来学习吧。

springboot 禁用某项健康检查

management.health.mail.enabled
management.health.mongo.enabled
management.health.redis.enabled
management.health.solr.enabled
management.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,走自己写的健康检查接口

以上为个人经验,希望能给大家一个参考,也希望大家多多支持。

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们