Springboot3.5.x版本actuator新属性

前言

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这个版本的变化还挺大的,增加了不少实用功能,如果能升级,可以用用新属性

相关推荐
只会写代码11 小时前
Spring 项目别再乱注入 Service 了!用 Lambda 封装个统一调用组件,爽到飞起
spring boot
扣丁梦想家11 小时前
PostgreSQL 入门到精通 + Java & Spring Boot 实战教程
数据库·spring boot·postgresql
n***632711 小时前
SpringCloud 微服务框架
spring·spring cloud·微服务
v***913011 小时前
Spring+Quartz实现定时任务的配置方法
android·前端·后端
海奥华211 小时前
分库分表技术详解:从入门到实践
数据库·后端·mysql·golang
切糕师学AI11 小时前
Spring 中的 @Service 注解
java·spring
想不明白的过度思考者11 小时前
Spring Web MVC从入门到实战
java·前端·spring·mvc
IUGEI11 小时前
【后端开发笔记】JVM底层原理-内存结构篇
java·jvm·笔记·后端
i***395812 小时前
Springboot中SLF4J详解
java·spring boot·后端
子洋12 小时前
群晖 DSM 更新后 Cloudflare DDNS 失效的排查记录
前端·后端·dns