Personal Notes of Spring Boot from 0 to Learn 13 --Supervision by spring boot actuator

1. Brief description

Supervision, it depends on what your program has, what it is running, what permissions and other things

2. How to use

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

Settings in application.properties

#有权利访问各种监管
management.endpoints.web.exposure.include=*

#打开shutdown功能(发送请求让Java程序关闭)
management.endpoint.shutdown.enabled=true

1) Some simple things

For example, if we visit http://localhost:8080/actuator/beans
Insert picture description here
any bean you have, it will be displayed here,
and for example, the visit will http://localhost:8080/actuator/env
Insert picture description here
display environment variables.

2)shutdown

I personally think that the coolest thing is shutdown, which can be used to close the Java program through the browser, but only after sending a post request.
http://localhost:8080/actuator/shutdown
Insert picture description here
Insert picture description here

3) More supervision

Official document

Guess you like

Origin blog.csdn.net/yi742891270/article/details/107858948