Spring Boot项目健康检测

Spring Boot是一种微服务架构,约定大于配置,免去了很多xml的配置。需要相关服务,我们可以在依赖中引入jar包即可。项目开发完成,我们需要验证项目是否正常工作,则可以通过如下简单几步实现。

1.引入jar包

   <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>

2.访问地址即可

访问如下地址:http://localhost:8088/health ,若项目正常,则会返回如下字符串。

{
"status":"UP",
"diskSpace":{
    "status":"UP",
    "total":278614876160,
    "free":235502956544,
    "threshold":10485760
}
}

更多推荐

Spring Boot项目健康检测