Spring Boot 2.2.0 发布

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

组件升级

  • Spring AMQP 2.2
  • Spring Batch 4.2
  • Spring Data Moore
  • Spring Framework 5.2
  • Spring HATEOAS 1.0
  • Spring Integration 5.2
  • Spring Kafka 2.3
  • Spring Security 5.2
  • Spring Session Corn

第三方库升级

  • Elasticsearch 6.7
  • Flyway 6.0
  • Jackson 2.10
  • JUnit 5.5
  • Micrometer 1.3
  • Reactor Dysprosium
  • Solr 8.0

性能提升

延迟初始化(Lazy initialization)

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

  • 初次处理HTTP请求耗时长
  • 本应在启动初始化时出现的问题, 延后出现

更多参考: 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"对指示器进行分组

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


文章同步发送到公众号:云编码 (微信号:sevenfeet)。

qrcode

comments powered by Disqus