Spring Boot 2.2.0 发布

译自: https://spring.io/blog/2019/10/16/spring-boot-2-2-0

组件升级

第三方库升级

性能提升

延迟初始化(Lazy initialization)

支持开启全局延迟加载spring.main.lazy-initialization. 代价:

更多参考: https://spring.io/blog/2019/03/14/lazy-initialization-in-spring-boot-2-2

Java 13支持

跟随Spring Framework5.2对Java 13的支持, Spring Boot 2.2现在也支持了Java13. 同时兼容Java 11和8.

不可变的@ConfigurationProperties绑定

现在加入了基于构造器的绑定, 允许@ConfigurationProperties标注的类不可变(属性不可变).

可通过@ConfigurationProperties标注类, 或者使用@ConstructorBinding标注构造器来开启.

额外的注解如@DefaultValue, @DateTimeFormt可对构造参数进行配置.

更多参考: https://docs.spring.io/spring-boot/docs/2.2.0.RELEASE/reference/html/spring-boot-features.html#boot-features-external-config-constructor-binding

RScoket支持

使用新的starterspring-boot-starter-rsocket自动配置.

Spring Security的RScoket集成在classpath中存在spring-security-rsocket时自动完成配置.

更多参考: https://docs.spring.io/spring-boot/docs/2.2.0.RELEASE/reference/html//spring-boot-features.html#boot-features-rsocket

健康指示器分组

支持对健康指示器(Health Indicator)进行分组. 比如将应用部署到Kubernetes时, 希望针对”liveness”和”readiness”对指示器进行分组

1
management.endpoint.health.group.custom.include=db 

检查时使用localhost:8080/actuator/health/custom

更多参考: https://docs.spring.io/spring-boot/docs/2.2.0.RELEASE/reference/html//production-ready-features.html#health-groups

其他变化

参考: https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.2-Release-Notes

Comments

comments powered by Disqus