Health接口,内部有个设计实现,当health接口的status不是UP时,访问health接口的http状态码为503,这个方式也挺好,对于一些工具而言(比如nginx 健康检查)比较方便,因为通过状态码就可以知道服务的健康情况。但是有时候,我们更希望通过health接口的返回内容来判断起实际状态,这个时候如果状态码不是200的话,可能影响请求解析。
我们可以通过如下代码,来自定义health接口的status与http状态码的关系。
@Bean @ConditionalOnProperty("management.health.status.static") public HealthStatusHttpMapper healthStatusHttpMapper() { HealthStatusHttpMapper healthStatusHttpMapper = new HealthStatusHttpMapper(); healthStatusHttpMapper.addStatusMapping(Status.DOWN,WebEndpointResponse.STATUS_OK); healthStatusHttpMapper.addStatusMapping(Status.UNKNOWN,WebEndpointResponse.STATUS_OK); healthStatusHttpMapper.addStatusMapping(Status.OUT_OF_SERVICE,WebEndpointResponse.STATUS_OK); return healthStatusHttpMapper; }
相关推荐
springboot 2.0优雅关机starter,支持Tomcat和Undertow Tomcat使用方式 properties配置 #server server.port=9088 logging.config=classpath:log4j2.xml #访问路径,配置后就和1.x版本路径一样 management.endpoints...
Health Monitoring in ASP.NET 2.0,asp.net的健康监测
spring boot+spring封装的mail邮件服务技术学习过程中简单练习的几个邮件类型demo项目源码
实测可用
新西兰Orion Health软件医院信息集成平台解决方案v2.0
旅客: ... 14天内行程 是否去过风险地区分为两种情况:如果是 就需要输入48小时核酸检测结果,如果核酸结果显示阳性的话,显示异常;如果否的话 就不弹出对话框 输入当日测的温度 如果温度在正常范围 显示正常 如果...
资源分类:Python库 所属语言:Python 资源全名:mypy-boto3-health-1.16.2.0.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
本篇文章主要介绍了详解关于springboot-actuator监控的401无权限访问,非常具有实用价值,有兴趣的可以了解一下
English simple Community Health Worker Helper, Health EHR CDI
附加接口ApplicationAliveIndicator 负载平衡器用于确定应用程序是否处于活动状态的快速廉价检查,每秒至少可调用一次。基本健康指标基本检查包括操作员用来跟踪应用程序运行状况的所有Spring Boot默认检查,每分钟...
Provides foundational knowledge and understanding of the implementation and use of electronic health records (EHRs) Explains the system design life cycle of an electronic health record implementation ...
2.0 Health Manager 监视应用程序的状态并确保启动的应用程序确实在运行,它们的版本和实例数量正确无误。 从概念上讲,这是通过维护应用程序的实际状态并将其与所需状态进行比较来完成的。 当发现差异时,启动动作...
Though lack of exercise has major health consequences, researchers are now examining the additional and widespread health risk of the simple act of sitting for extended periods. With research from ...
作动器-公开一些方法,例如springboot作动器(/ health,/ metrics,/ env,/ info) config-连接到“ spring cloud配置服务器”并加载配置 尤里卡-使用尤里卡服务注册,注销和心跳 如何使用? 我们有两种选择...
开源项目-sohlich-healthcheck.zip,sohlich/healthcheck go application healthcheck library
VMware vSphere Health Check健康检查报告
Drive Health (检测硬盘寿命) 中文绿色版.rar
a code that can calculate health index