spring_reference/V. Spring Boot Actuator: Pr.../39. Enabling production-rea...

1.3 KiB
Raw Blame History

Spring Boot执行器Production-ready特性

Spring Boot包含很多其他的特性它们可以帮你监控和管理发布到生产环境的应用。你可以选择使用HTTP端点JMX或远程shellSSH或Telnet来管理和监控应用。审计Auditing健康health和数据采集metrics gathering会自动应用到你的应用。

39. 开启production-ready特性

spring-boot-actuator模块提供了Spring Boot所有的production-ready特性。启用该特性的最简单方式就是添加对spring-boot-starter-actuator Starter POM的依赖。

执行器Actuator的定义:执行器是一个制造业术语,指的是用于移动或控制东西的一个机械装置。一个很小的改变就能让执行器产生大量的运动。

基于Maven的项目想要添加执行器只需添加下面的'starter'依赖:

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

对于Gradle使用下面的声明

dependencies {
    compile("org.springframework.boot:spring-boot-starter-actuator")
}