springboot中端点监管 endpoint actuator
生活随笔
收集整理的這篇文章主要介紹了
springboot中端点监管 endpoint actuator
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
1.pom文件
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.zy</groupId><artifactId>spring-boot-monitor-demo</artifactId><version>0.0.1-SNAPSHOT</version><packaging>jar</packaging><name>spring-boot-monitor-demo</name><description>Demo project for Spring Boot</description><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.0.4.RELEASE</version><relativePath/> <!-- lookup parent from repository --></parent><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding><java.version>1.8</java.version></properties><dependencies><!-- 端點(diǎn)監(jiān)管 endpoint actuator --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-actuator</artifactId></dependency><!-- web --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><!-- 熱部署 --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-devtools</artifactId><scope>runtime</scope></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><optional>true</optional></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins></build></project>2.application.yml文件
management:security:
enabled: false
info:
app:
id: hello
version: 1.0.0
# 設(shè)置為true時(shí),支持遠(yuǎn)程關(guān)閉服務(wù):只需要發(fā)送post請求,后綴是shutdown即可,如:
# localhost:8080/shutdown
endpoints:
shutdown:
enabled: true
# 關(guān)閉所有端點(diǎn)
enabled: false
# 只留一個(gè)端點(diǎn)
beans:
enabled: true
# 定制endpoint的id或者訪問路徑
# beans:
# id: mybean ?
?3.端點(diǎn)相關(guān)信息
?
?
轉(zhuǎn)載于:https://www.cnblogs.com/psy-code/p/9575455.html
總結(jié)
以上是生活随笔為你收集整理的springboot中端点监管 endpoint actuator的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 关闭页面那点事儿...
- 下一篇: 题目清单