前言
Springboot3.5.x版本发布之后,下载heapdump文件需要配置,使其更加安全
示例
1、创建一个Springboot3.5.x版本
2、加入
actuator
相关包
xml
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
3、开启配置
ini
server.port=8011
spring.profiles.active=dev
spring.application.name=demo-actuator
management.endpoints.web.exposure.include=*
management.endpoint.health.show-details=always
4、访问
bash
http://localhost:8011/actuator/info
输出
5、这个时候访问
bash
http://localhost:8011/actuator/heapdump
输出 6、开启heapdump配置 在
application-dev.yml
开启配置
yaml
management:
endpoint:
heapdump:
access: unrestricted
访问
bash
http://localhost:8011/actuator/heapdump
会下载

总结
Spring Boot3.5.x这个版本的变化还挺大的,增加了不少实用功能,如果能升级,可以用用新属性