:version: 3.2.0-M2
: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-M2 Release Notes

For changes in earlier milestones, please refer to:

- link:Spring-Boot-3.2.0-M1-Release-Notes[v3.2.0-M1]


== Upgrading from Spring Boot 3.1



=== Minimum Requirements Changes
None.



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



=== Support for Virtual Threads
Some `synchronized` blocks have been refactored to use `ReentrantLock` instead.

A virtual thread executor is now auto-configured for the RabbitMQ listener if virtual threads are enabled.

A virtual thread executor is now auto-configured for the Kafka listener if virtual threads are enabled.



==== Task Execution
A `SimpleAsyncTaskExecutorBuilder` is now available in the application context and can be used to build a `SimpleAsyncTaskExecutor`. `SimpleAsyncTaskExecutorCustomizer` beans can be used to customize the built `SimpleAsyncTaskExecutor`. If virtual threads are enabled, the builder is auto-configured to use them.



==== Task Scheduling
A `SimpleAsyncTaskSchedulerBuilder` is now available in the application context and can be used to build `SimpleAsyncTaskScheduler`.
`SimpleAsyncTaskSchedulerCustomizer` beans can be used to customize the built `SimpleAsyncTaskScheduler`. If virtual threads are enabled, the builder is auto-configured to use them.

When virtual threads are enabled, the `taskScheduler` bean will be a `SimpleAsyncTaskScheduler` configured to use virtual threads.
The `spring.task.scheduling.thread-name-prefix` property and `spring.task.scheduling.simple.*` properties are applied.
Other `spring.task.scheduling.*` properties are ignored as they are specific to a pool-based scheduler.

=== Observability Improvements
Observability for R2DBC has been added. To enable it, include the `io.r2dbc:r2dbc-proxy` dependency in your project.

The auto-configuration for OpenTelemetry has been improved. If there's a bean of type `SdkLoggerProvider` or `SdkMeterProvider` in the context, it will automatically get registered on the `OpenTelemetry` bean.
Additionally, OpenTelemetry's `Resource` is now exposed as a bean, and there's a new configuration property `management.opentelemetry.resource-attributes` which configures the resource attributes.



=== Docker Image Building



==== Default CNB Builders Upgraded
The default CNB builders used when building images with the Maven and Gradle plugin have changed. 
When the GraalVM plugin is applied to the build, the new default builder is `paketobuildpacks:builder-jammy-tiny`. 
Otherwise, the new default builder is `paketobuildpacks:builder-jammy-base`.
See the https://paketo.io/docs/reference/builders-reference/[Paketo documentation] for more information on these builders. 

The previous default builders included a run image based on Ubuntu 18.04, and the new defaults include a run image based on Ubuntu 22.04. 
This means that any images built with the new defaults will be based on Ubuntu 22.04.



==== Bind Mounts for Caches
The build and launch caches used by CNB builders and buildpacks can now be configured to use bind mounts instead of named volumes. 
This feature has been requested by users of BitBucket CI, which do not allow volumes to be accessed from CI pipelines. 
See the {maven-plugin-docs}/#build-image.examples.caches[Maven] and {gradle-plugin-docs}/#build-image.examples.caches[Gradle] documentation for more information and examples. 



=== Support for `JdbcClient`
Auto-configuration for {reference-docs}/data.html#data.sql.jdbc-client[`JdbcClient`] has been added, based on the presence of a `NamedParameterJdbcTemplate`.
If the latter is auto-configured, properties of `spring.jdbc.template.*` are taken into account.



=== WebSocketServerSpec Configuration
The `WebSocketServerSpec` used by the auto-configuration can be customized using properties of the `spring.rsocket.server.spec` namespace.



=== Neo4j `AuthTokenManager`
If an `AuthTokenManager` bean is defined, it will be used for authentication with Neo4j.
Such a bean takes precedence over the `spring.neo4j.authentication.*` properties.
An `AuthTokenManager` bean is ignored if custom `Neo4jConnectionDetails` are defined, for example for a service connection to a Testcontainers or Docker Compose managed database.



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

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

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

* Elasticsearch Client 8.9.0
* Flyway 9.21.2
* JUnit 5.10.0
* Micrometer 1.11.0-M2
* Micrometer Tracing 1.1.0-M2
* SnakeYAML 2.1



=== Miscellaneous
Apart from the changes listed above, there have also been lots of minor tweaks and improvements including:

* Add support for RabbitMQ container `forceStop` property.
* Add support for Kafka MessageListenerContainer `changeConsumerThreadName` property.
* Auto-configure `Function<MessageListenerContainer, String>` bean to Kafka MessageListenerContainer's `threadNameSupplier`.
* `@ConditionalOnVirtualThreads` has been superseded by `@ConditionalOnThreading(Threading.VIRTUAL)`.
* When using GraalVM, resource hints for `messages.properties` and `messages_*.properties` are now provided automatically.



== Deprecations in Spring Boot 3.2.0-M2
* The configuration property `management.otlp.metrics.export.resource-attributes` has been deprecated in favor of the new `management.opentelemetry.resource-attributes`.
* `TaskExecutorBuilder` has been deprecated in favor of `ThreadPoolTaskExecutorBuilder`.
* `TaskSchedulerBuilder` has been deprecated in favor of `ThreadPoolTaskSchedulerBuilder`.
