-
Notifications
You must be signed in to change notification settings - Fork 40.8k
Spring Boot 3.2.0 M1 Release Notes
The default log output now includes your application name whever you have a spring.application.name
property set.
If you prefer the previous format, you can set logging.include-application-name
to false
.
There’s a bug in 1.9.0 of the Kotlin Gradle Plugin that causes additional resource directories to be lost. This breaks native image compilation as resources generated by AOT processing are not included in the native image’s classpath. To work around the problem, apply Kotlin’s Gradle plugin first.
Tip
|
Check the configuration changelog for a complete overview of the changes in configuration. |
Spring Boot 3.2 ships support for virtual threads.
To use virtual threads, you need to run on Java 21 and set the property spring.threads.virtual.enabled
to true
.
When virtual threads are enabled, Tomcat and Jetty will use virtual threads for request processing. This means that your application code that is handling a web request, such as a method in a controller, will run on a virtual thread.
When virtual threads are enabled, the applicationTaskExectuor
bean will be a SimpleAsyncTaskExecutor
configured to use virtual threads.
Anywhere that uses the application task executor, such as @EnableAsync
when calling @Async
methods, Spring MVC’s asynchronous request processing, and Spring WebFlux’s blocking execution support will now utilize virtual threads.
As before, any TaskDecorator
bean is applied to the auto-configured executor and the spring.task.execution.thread-name-prefix
property is applied.
Other spring.task.execution.*
properties are ignored as they are specific to a pool-based executor.
Spring WebFlux’s support for block execution is auto-configured to use the applicationTaskExecutor
bean when it is an AsyncTaskExecutor
. The applicationTaskExecutor
is an AsyncTaskExecutor
both by default and when virtual threads are enabled.
Spring for GraphQL is now auto-configured to use the applicationTaskExecutor
.
This enables out of the box support for controller methods that return Callable
.
Observations starting with a prefix can now be disabled via properties.
For example, to prevent Spring Security from reporting observations, set management.observations.enable.spring.security=false
.
The property management.observations.key-values.*
can be used to automatically apply low-cardinality key-values to all observations.
For example setting management.observations.key-values.region=us-west
will add the key region
with the value us-west
to all observations.
The default value of management.otlp.tracing.endpoint
has been removed. The OtlpHttpSpanExporter
bean is now only auto-configured if management.otlp.tracing.endpoint
has a value. To restore the old behavior, set management.otlp.tracing.endpoint=http://localhost:4318/v1/traces
.
If you are using AspectJ, ObservedAspect
is now auto-configured to intercept types or methods annotated with @Observed
.
If you’re using OpenTelemetry and you want more control over the applied SpanProcessor
, you can now define a bean of type SpanProcessors
. By default, all available SpanProcessor
beans are applied. The same works with OpenTelemetry’s SpanExporter
, use a SpanExporters
bean to override the default. By default it applies all available SpanExporter
beans.
If an OpenTelemetry MeterProvider
bean is found, it is automatically registered on the BatchSpanProcessor
.
Micrometer Tracing’s ObservationHandler
beans are automatically registered on the ObservationConfig
. Before Spring Boot 3.2.0, uncategorized handlers have been registered before the categorized ones. This has been flipped, categorized handlers are now registered before the uncategorized ones. See #34399 for details.
The default format for B3 trace propagation has been changed from single-no-parent to single.
@Scheduled
methods are now instrumented for observability.
Before Spring Boot 3.2 the whole Micrometer Tracing, Brave and OpenTelemetry infrastructure has been disabled when running integration tests.
This has been reworked: only the minimum number of beans are disabled so that no spans are sent to backends (see #35354 for the list of beans which will be disabled).
If you have custom Brave SpanHandler
or OpenTelemetry SpanExporter
beans, please make sure to annotate them with @ConditionalOnEnabledTracing
so that they won’t be created when running integration tests with observability switched off.
In case you want to run your integration tests with observability enabled, you can use the @AutoConfigureObservability
annotation on the test class.
Spring Boot will now automatically log correlation ID whenever you are using Micrometer tracing. See the updated documenation for details.
Spring Boot 3.2 includes support for the new RestClient
interface which has been introduced in Spring Framework 6.1.
This interface provides a functional style blocking HTTP API with a similar to design to WebClient
.
Existing and new application might want to consider using RestClient
as an alternative to RestTemplate
.
See the updated reference documentation for details.
When Jetty’s HttpClient
is on the classpath, Spring Boot’s HTTP client auto-detection will now configure RestTemplateBuilder
to use the new JettyClientHttpRequestFactory
that was introduced in Spring Framework 6.1.
Support for JdkClientHttpRequestFactory
has been added to ClientHttpRequestFactories
.
Unlike JettyClientHttpRequestFactory
it has not been added to the auto-detection. To use JdkClientHttpRequestFactory
you must opt in:
@Bean
RestTemplateBuilder restTemplateBuilder(RestTemplateBuilderConfigurer configurer) {
return configurer.configure(new RestTemplateBuilder())
.requestFactory(
(settings) -> ClientHttpRequestFactories.get(JdkClientHttpRequestFactory.class, settings));
}
The auto-configured JwtDecoder
or ReactiveJwtDecoder
will now use any OAuth2TokenValidator<Jwt>
beans for token validation. They are included in a DelegatingOAuth2TokenValidator
that is configured as the decoder’s validator.
Support for ServiceConnection
has been added for ActiveMQ, with integration for both Testcontainers and Docker Compose.
The integration uses the symptoma/activemq
image.
Spring Boot 3.2.0-M1 moves to new versions of several Spring projects:
Numerous third-party dependencies have also been updated, some of the more noteworthy of which are the following:
-
Flyway 9.20
-
OkHttp 4.11
-
Rabbit AMQP Client 5.18.0
-
SnakeYAML 2.0
Apart from the changes listed above, there have also been lots of minor tweaks and improvements including:
-
Added a property to configure the maximum amount of connections for Jetty servers.
-
The port information logged when an embedded WebServer starts has been improved and made more consistent.
-
Added a property to configure the base
TimeUnit
of exported metrics in OTLP registry. -
A new property,
flyway.postgresql.transactional-lock
can be used to configure Flyway’s use of transactional locks with PostgreSQL. -
When creating a
PemSslStoreBundle
programatically, a key store password can now be provided.
-
Deprecated
management.metrics.tags.
, please usemanagement.observations.key-values.
instead -
Most constants defined in
LoggingSystemProperties
andLogbackLoggingSystemProperties
have been deprecated in favor of enum values -
Support for enabled request buffering in
ClientHttpRequestFactorySettings
andRestTemplateBuilder
has been deprecated. While the API remains in deprecated form, configuring it will have no effect following similar changes in Spring Framework 6.1. -
Registering additional
ApplicationContextInitializer
using thecontext.initializer.classes
environment property is deprecated in favor of registering each delegate programatically or in spring.factories. -
Registering additional
ApplicationListener
using thecontext.listener.classes
environment property is deprecated in favor of registering each delegate programatically or in spring.factories. -
Flyway properties that are managed by an extension have moved to a dedicated namespace. As a result,
flyway.oracle*
properties have moved toflyway.oracle.*
. Similarly, thespring.flyway.sql-server-kerberos-login-file
has moved tospring.flyway.sqlserver.kerberos-login-file
. -
Support for InfluxDB has been deprecated in favor of the new InfluxDB Java client and its own Spring Boot integration.