-
Notifications
You must be signed in to change notification settings - Fork 40.2k
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
.
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 and Spring MVC’s asynchronous request processing, 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.
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
.
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.
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:
-
…
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
-
When registering
ObservationHandler
, custom handlers are now registered after the infrastructure handlers. See #34399 for details. -
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.
-
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.