:version: 3.2.0-M1
:reference-docs: https://docs.spring.io/spring-boot/docs/{version}/reference/html/
:gradle-plugin-docs: https://docs.spring.io/spring-boot/docs/{version}/gradle-plugin/reference/htmlsingle
:maven-plugin-docs: https://docs.spring.io/spring-boot/docs/{version}/maven-plugin/reference/htmlsingle

= Spring Boot 3.2.0-M1 Release Notes



== Upgrading from Spring Boot 3.1



=== Logged Application Name
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`.



=== Kotlin 1.9.0 and Gradle
There's https://youtrack.jetbrains.com/issue/KT-60459/Gradle-Plugin-overwrites-resource-directories[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.



=== Minimum Requirements Changes
None.



=== Deprecations from Spring Boot 3.0

Classes, methods, and properties that were deprecated in Spring Boot 3.0 have been removed in this release. Please ensure that you aren’t calling deprecated methods before upgrading.



== New and Noteworthy
TIP: Check link:Spring-Boot-3.2.0-M1-Configuration-Changelog[the configuration changelog] for a complete overview of the changes in configuration.



=== Support for Virtual Threads
Spring Boot 3.2 ships support for https://openjdk.org/jeps/444[virtual threads].
To use virtual threads, you need to run on Java 21 and set the property `spring.threads.virtual.enabled` to `true`.



==== Servlet Web Servers
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.



==== Task Execution
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.



=== Blocking Execution with Spring WebFlux
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's Callable Support
Spring for GraphQL is now auto-configured to use the `applicationTaskExecutor`.
This enables out of the box support for controller methods that return `Callable`.



=== Observability Improvements
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 https://github.com/spring-projects/spring-boot/issues/34399[#34399] for details.

The default format for B3 trace propagation has been changed from single-no-parent to https://github.com/openzipkin/b3-propagation#single-header[single].

`@Scheduled` methods are now instrumented for observability.

==== Observability in Tests
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 https://github.com/spring-projects/spring-boot/issues/35354[#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 {reference-docs}/#features.html#features.testing.spring-boot-applications.tracing[use the `@AutoConfigureObservability` annotation] on the test class.



=== Logging Correlation IDs
Spring Boot will now automatically log correlation ID whenever you are using Micrometer tracing.
See the {reference-docs}/actuator.html#actuator.micrometer-tracing.logging[updated documenation] for details.



=== RestClient Support
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 {reference-docs}/io.html#io.rest-client.restclient[the updated reference documentation] for details.



=== RestTemplate HTTP Clients
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:

[source,java]
----
@Bean
RestTemplateBuilder restTemplateBuilder(RestTemplateBuilderConfigurer configurer) {
    return configurer.configure(new RestTemplateBuilder())
        .requestFactory(
                (settings) -> ClientHttpRequestFactories.get(JdkClientHttpRequestFactory.class, settings));
}
----



=== Docker Image Building


==== Docker Host Configuration
The `spring-boot:build-image` Maven goal and `bootBuildImage` Gradle task now use Docker CLI configuration files to determine the host address and other connection details for the Docker daemon that should be used by default. 
See the {gradle-plugin-docs}/#build-image.docker-daemon[Gradle] and {maven-plugin-docs}/#build-image.docker-daemon[Maven] plugin documentation for more information. 


=== Additional OAuth2 Token Validators
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.



=== Service Connection Support for ActiveMQ
Support for `ServiceConnection` has been added for ActiveMQ, with integration for both Testcontainers and Docker Compose.
The integration uses the `symptoma/activemq` image.


 
=== Dependency Upgrades
Spring Boot 3.2.0-M1 moves to new versions of several Spring projects:

* https://github.com/spring-projects/spring-batch/releases/tag/v5.1.0-M1[Spring Batch 5.1.0-M1]
* https://github.com/spring-projects/spring-data-bom/releases/tag/2023.1.0-M1[Spring Data 2023.1.0-M1]
* https://github.com/spring-projects/spring-framework/releases/tag/v6.1.0-M3[Spring Framework 6.1.0-M3]
* https://github.com/spring-projects/spring-hateoas/releases/tag/2.2.0-M2[Spring HATEOAS 2.2.0-M2]
* https://github.com/spring-projects/spring-integration/releases/tag/v6.2.0-M1[Spring Integration 6.2.0-M1]
* https://github.com/spring-projects/spring-ldap/releases/tag/3.2.0-M1[Spring LDAP 3.2.0-M1]
* https://github.com/spring-projects/spring-security/releases/tag/6.2.0-M1[Spring Security 6.2.0-M1]
* https://github.com/spring-projects/spring-session/releases/tag/3.2.0-M1[Spring Session 3.2.0-M1]


Numerous third-party dependencies have also been updated, some of the more noteworthy of which are the following:

* https://activemq.apache.org/components/artemis/download/release-notes-2.29.0[Artemis 2.29]
* https://github.com/openzipkin/brave/releases/tag/5.16.0[Brave 5.16]
* Flyway 9.20
* https://downloads.apache.org/kafka/3.5.0/RELEASE_NOTES.html[Kafka 3.5]
* https://kotlinlang.org/docs/whatsnew19.html[Kotlin 1.9]
* https://forum.liquibase.org/t/liquibase-4-23-0-released/8384[Liquibase 4.23]
* https://github.com/micrometer-metrics/micrometer/releases/tag/v1.12.0-M1[Micrometer 1.12.0-M1]
* https://github.com/micrometer-metrics/tracing/releases/tag/v1.2.0-M1[Micrometer Tracing 1.2.0-M1]
* https://github.com/mockito/mockito/releases/tag/v5.4.0[Mockito 5.4]
* https://dev.mysql.com/doc/relnotes/connector-j/8.1/en/[MySQL 8.1]
* https://github.com/neo4j/neo4j-java-driver/releases/tag/5.10.0[Neo4j Java Driver 5.10]
* OkHttp 4.11
* https://github.com/open-telemetry/opentelemetry-java/releases/tag/v1.28.0[OpenTelemetry 1.28]
* Rabbit AMQP Client 5.18.0
* https://github.com/rabbitmq/rabbitmq-stream-java-client/releases/tag/v0.11.0[Rabbit Stream Client 0.11]
* https://github.com/reactor/reactor/releases/tag/2023.0.0-M1[Reactor 2023.0.0-M1]
* SnakeYAML 2.0


=== Miscellaneous
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. 


== Deprecations in Spring Boot 3.2.0-M1
* Deprecated `management.metrics.tags.*`, please use `management.observations.key-values.*` instead
* Most constants defined in `LoggingSystemProperties` and `LogbackLoggingSystemProperties` have been deprecated in favor of enum values
* Support for enabled request buffering in `ClientHttpRequestFactorySettings` and `RestTemplateBuilder` 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 the `context.initializer.classes` environment property is deprecated in favor of registering each delegate programatically or in spring.factories.
* Registering additional `ApplicationListener` using the `context.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 to `flyway.oracle.*`. Similarly, the `spring.flyway.sql-server-kerberos-login-file` has moved to `spring.flyway.sqlserver.kerberos-login-file`.
* Support for InfluxDB has been deprecated in favor of the https://github.com/influxdata/influxdb-client-java[new InfluxDB Java client] and https://github.com/influxdata/influxdb-client-java/tree/master/spring[its own Spring Boot integration].
