Spring Boot 2 is officially out of maintenance. . Goodbye, Java 8! !

Hello everyone, I am the stack manager.

Yes, just yesterday, Spring Boot 2.x stopped being maintained. .

Spring Boot’s last 2.x version2.7.x has stopped maintenance, and 3.0.x has also stopped maintenance, and is commercially supported The version is only 2.6.x, and versions below 2.5.x have completely withdrawn from the stage of history. .

You can see the end time of each version from the roadmap,Including the latest Spring Boot 3.2.0, it will also end in one year, therefore, the cessation of maintenance of Spring Boot 2 is a foreseeable and inevitable result. The Spring team will only focus more time and resources on the development and maintenance of the new version, which is also to promote the development of the entire Java ecosystem.

At the same time, yesterday, Spring Boot also released four versions at once:

  • 3.2.0
  • 3.1.6
  • 3.0.13
  • 2.7.18

The latest version is shown below:

Therefore, 3.0.13 and 2.7.18 may be the last versions of this version line, and 2.7.18 is the last version to support Java 8.

Come take a look at the latest 3.2.0 new features! !

New features in Spring Boot 3.2.0

1. Minimum environmental requirements

Spring Boot 3.0.0 begins to support and requires at least Java 17, and Spring Boot 3.1.5 begins to support Java 21.

Comparison table of requirements for Java development environment:

Spring Boot JDK Spring Maven Gradle
3.2.0 17 ~ 21 6.1.1+ 3.6.3+ 7.5+,8.x
3.1.0 17 ~ 20 6.0.9+ 3.6.3+ 7.5+,8.x
3.0.0 17 ~ 19 6.0.2+ 3.5+ 7.5+
2.7.12 8 ~ 20 5.3.27+ 3.5+ 6.8.x, 6.9.x, 7.x, 8.x

The last Spring Boot 2.x series version that supports Java 8 has been retired. The new era of Java 17 has arrived. If you are still stuck in Java 8, you are OUT. In the past year, Java 8 has been cut in half! Java 17 surges 430%! !

You can sign up to learn the "Java 17 New Features Practical Course" produced by the stack leader. A good course is not expensive. 199 yuan for permanent learning. , if new content of Java 21 and more versions is released later, it will be updated for free.

2. Support virtual threads

What is a virtual thread?

Virtual thread is alow-cost, lightweight user-mode thread implementation, also known as the legendary "", which can make full use of available hardware and greatly reduce the workload of writing, maintaining and monitoring high-concurrency applications. Coroutine

We all know that we need to be very careful when using threads, because the creation and destruction of threads consumes system resources, so we have a thread pool, but this is not enough, because the number of threads is limited, and threads will block operating system threads and cannot Improve throughput as much as possible.

Because the cost of using threads is very high, there is a virtual thread. It is a user-mode thread and the cost is quite low. Scheduling is also completely controlled by the user (scheduler in JDK). It can also block, but There is no need to block operating system threads, which fully improves hardware utilization and increases concurrency by an order of magnitude, thus achieving high throughput.

Virtual threads were introduced for the first time in Java 19 and are officially available for production in Java 21.

Spring Boot 3.1.5 is compatible with Java 21,Spring Boot 3.2.0 can officially support virtual threads in Java 21, just add the following configuration:

spring.threads.virtual.enabled = true

The specific usage will be updated later in my "Spring Boot Core Technology Course".

3. Support CRaC

Spring Boot 3.2.0 adds initial support for CRaC. The full name of CRaC is: Coordinated Restore at Checkpoint, this is a project supported by OpenJDK. It mainly deals with setting checkpoints (making images, snapshots) for Java applications without affecting their execution, and can be performed through checkpoints recover.

The details are as follows:

https://openjdk.org/projects/crac/

4. SSL Bundle reloading

Automatic reloading is now supported when key information related to SSL bundles changes.

Web servers that currently support SSL Bundle reloading:·

  • Netty web server
  • Tomcat web server

You need to set reload-on-update = true in the SSL Bundle. The reference example is as follows:

spring.ssl.bundle.pem.mybundle.reload-on-update=true spring.ssl.bundle.pem.mybundle.keystore.certificate=file:/some/directory/application.crt spring.ssl.bundle.pem.mybundle.keystore.private-key=file:/some/directory/application.key

The file monitor monitors the key file and if the file changes, the SSL Bundle is reloaded.

5. Observability improvements

1) Various annotations of Micrometer can now be used, including: @Timed, @Counted, @NewSpan, a>@ContinueSpan, @Observed, etc., if AspectJ is integrated, these aspects will be automatically configured.

2) The ObservationHandler related Beans used by Micrometer tracking will now be automatically registered to the ObservationConfig configuration class.

3) The default format of B3 trace propagation is changed from single-no-parent to single.

4) Observability support is now provided for methods annotated with @Scheduled.

5) Observability support for R2DBC is now added.

6. More support items

Spring Boot 3.2.0 has updated a large number of Spring libraries and third-party libraries.

Also added support and improvements for the following technologies:

  • RestClient
  • JdbcClient
  • Jetty
  • Spring for Apache Pulsar
  • Add SSL bundle support for Kafka, RabbitMQ
  • Nested Jar support
  • Docker image building improvements

7. Change items

Several important changes:

1) Remove OkHttp 3 and support OkHttp 4.

2) Reference number management.metrics.tags. Subject management.observations.key-values. Substitute.

3) Many constants in the LoggingSystemProperties and LogbackLoggingSystemProperties classes were removed and replaced by related enumerations.

4) Flyway number change, flyway.oracle* subject flyway.oracle.* substitute, spring.flyway.sql-server-kerberos-login-file subject spring.flyway.sqlserver.kerberos-login-file Substitute.

5) Line change pond change, TaskExecutorBuilder 类cover ThreadPoolTaskExecutorBuilder 类代代, TaskSchedulerBuilder 类cover < a i=4> Class change. ThreadPoolTaskSchedulerBuilder

For more details, please refer to the official release notes:

https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.2.0-Release-Notes

Summarize

Spring Boot has changed quite a lot this time, especially the cessation of maintenance of the Spring Boot 2.x series, and the new version of Spring Boot 3.2.0 that supports virtual threads.

No matter what, don't be obsessed with the past. All versions will be history. As a technical person, we must look forward and constantly update our knowledge and skills is the most important thing.

The latest and most complete practical code of Spring Boot has been uploaded to Github:

https://github.com/javastacks/spring-boot-best-practice

If you haven’t used Spring Boot yet, here is the recommendation of Zhang Zhan’s "Spring Boot Core Technology Course", which has 16 modules. It involves almost all core technologies, including underlying implementation principles and code practice. It has very complete knowledge points to help you quickly get through all aspects of Spring Boot.

Well, that’s it for today’s sharing. The stack manager will continue to pay attention and share more Spring Boot information and useful information, and pay attention to the public account Java technology stack for the first time.

Copyright Statement: This article is original from the public account "Java Technology Stack". Please indicate the source when reprinting or quoting the content of this article. Any plagiarism or reprinting will be reported as infringement and you will be responsible for the consequences. , and reserves the right to pursue its legal liability.

Recommended recent popular articles:

1.1,000+ Java interview questions and answers (2022 latest version)

2.Excellent! Java coroutines are coming. . .

3.Spring Boot 2.x tutorial, so complete!

4.Stop filling the screen with explosions and explosions. Try the decorator mode. This is the elegant way! !

5."Java Development Manual (Songshan Edition)" is newly released, download it quickly!

If you think it’s good, don’t forget to like and retweet!

Guess you like

Origin blog.csdn.net/youanyyou/article/details/134690438