#
Spring Boot 3 New Features
The Spring team released Spring Boot 3 in November 2022.
Info
Spring Boot 3 is based on Spring Framework 6.0 and Jakarta EE 9.
Here are the most important new features of Spring Boot 3.0 :
1. We need minimum JDK 17
In this case we can use the new improvements of JDK 17 or greater
2. Jakarta EE 9 is used instead Java EE
The package namespace changed from javax.* to jakarta.*.
3. Spring Observability improvements
Spring Boot 3 is using Micrometer and Micrometer Tracing (formerly Spring Cloud Sleuth). Now, developers can record various application metrics and provide tracing support to tools such as OpenZipkin and OpenTelemetry.
4. GraalVM Native Image Support
With Spring Boot 3.0, developers can convert applications directly into GraalVM native image. This is a built-in support for creating native executables through Ahead-of-Time (AOT) compilation with GraalVM Native Image compiler. Using this feature, the Java applications have a lesser memory footprint and a faster execution.
5. Log4j2 Enhancements
The <SpringProfile>
tag lets developers create custom configurations based on active Spring profiles.
Log4j2 can be customized based on Spring Boot properties.
6. Simplified configuration of Testcontainers
Info
Testcontainers is an open source framework for providing throwaway, lightweight instances of databases, message brokers, web browsers, or just about anything that can run in a Docker container.
Starting from Spring Boot 3.1, the new @ServiceConnection
annotation can be used on the container instance fields of your tests.
In this case the connection to the database, message broker, etc started on that container will be done under the hood,
without using @DynamicPropertySource
. More information you have
here.
Info
@DynamicPropertySource
is a method-level annotation that you can use to register dynamic properties to be added to
the set of PropertySources in the Environment for an ApplicationContext loaded for an integration test.