December 16 SpringBoot2.2 released, what changes to its

December 16 SpringBoot2.2 released, what new changes have it?  I'll tell you

This month (October 16, 2019) Spring Boot 2.2 has been officially released! In this article, we will introduce version 2.2 to bring you what important new changes. I carefully write, want to forward concerns after reading is completed, your support is my motivation to create inexhaustible!

A, Spring bean configuration global initialization delay

A new feature introduced in Spring Boot 2.2 is a global delay bean initialization supported (by default, this feature is disabled). So how will you enable global time delay bean initialization?

  • All Spring Bean and its dependencies initialization, only when they are used to when was only created.

To reduce the initialization process and the startup time of the application, you can now use the following attribute configuration to enable global lazy initialization Spring bean:

spring.main.lazy.initialization=true

But the disadvantage of the global initialization delay is obvious, during any initialization delays, HTTP requests first treatment may take longer. Subsequent requests will not be affected. So it should be used with caution. If you do not want to use lazy initialization Spring Bean globally, you might consider using @Lazy comments configuration lazy initialization for a particular bean.

JMX is disabled under the Second, by default

Starting Spring Boot 2.2, JMX is disabled by default. This helps to shorten the startup time of the application, and do not waste a lot of resources at runtime. If you rely on JMX, you can enable it again:

spring.jmx.enabled=true

Third, annotated @ConfigurationProperties class is initialized bean

Spring Boot Bean for each @ConfigurationProperties create a class by class configuration scanning path of discovery. In previous versions of the development process, if we want to configure the class is initialized to a bean, you need to use @Component notes make it in the configuration bean class. Now we do not need, and only need a @ConfigurationProperties comment.

Note: If you are using two notes, annotated classes might create two bean, so please remove the comment @Component out. Do not use two together.

Four, Java 13 support

December 16 SpringBoot2.2 released, what new changes have it?  I'll tell you

Java 13 on September 17, 2019 officially released.

Spring Framework 5.2 and Spring Boot 2.2 is also supported Java13. LTS Java version 8 and 11 will remain compatible with Spring Boot 2.2.

5, configuration (key) change

Spring Boot 2.2 introduces a number of new configuration. Some configuration is not recommended and deleted. The more important changes are:

  • logging.file property has been renamed to logging.file.name
  • logging.path property has been renamed to logging.file.path

December 16 SpringBoot2.2 released, what new changes have it?  I'll tell you

Sixth, rely upgrade

Spring Boot 2.2 comes with many dependencies upgrade.

Spring dependencies associated with the upgrade:

  • Spring Framework 5.2.0
  • Spring AMQP 2.2.0
  • Spring Batch 4.2.0
  • Spring Data Moore RELEASE
  • Spring HATEOAS 1.0.0
  • Spring Integration 5.2.0
  • Spring Kafka 2.3.0
  • Spring Security 5.2.0
  • Spring Session Corn

Other most important upgrade dependencies:

  • Elasticsearch 6.8.3(see breaking changes: in6.5,6.6and6.7)
  • Flyway 6.0.6
  • HSQLDB 2.5.0
  • Jackson 2.10.0
  • Jersey 2.29.1
  • Kafka 2.3.0
  • Kotlin 1.3.50
  • Lombok 1:18:10
  • Micrometer 1.3
  • Netty 4.1.42
  • Reactor Dysprosium
  • Solr 8.2.0
  • Tomcat 9.0.27

Test dependencies upgrade:

  • AssertJ 3.13.2(breaking changes)
  • Hamcrest 2.1
  • Mockito 3.1.0
  • Junit 5.5.2(JUnit 5’s vintage engine still support existing JUnit 4-based test classes so no breaking changes here)

Look forward to your attention

Guess you like

Origin www.cnblogs.com/zimug/p/11741715.html