-
Notifications
You must be signed in to change notification settings - Fork 41.6k
Spring Boot 3.5.0 RC1 Release Notes
Thus far, Spring Boot auto-configures a TaskExecutor with the taskExecutor and applicationTaskExecutor bean names.
As of this release, only the applicationTaskExecutor bean name is provided.
Code that is requesting the auto-configured Executor by name should be adapted to use applicationTaskExecutor.
If you relied on this behaviour and cannot change it immediately, the alias can be added using a BeanFactoryPostProcessor, as shown in the following example:
@Configuration
public class MyConfiguration {
@Bean
static BeanFactoryPostProcessor taskExecutorAliasBeanFactoryPostProcessor() {
return (beanFactory) -> beanFactory.registerAlias("applicationTaskExecutor", "taskExecutor");
}
}JSON output for ECS structure logging has been updated to use the nested format. This should improve compatibility with the backends that consume the JSON.
See https://github.com/spring-projects/spring-boot/issues/45063 for background
The TestRestTemplate now uses the same follow redirects settings as the regular RestTemplate.
The HttpOption.ENABLE_REDIRECTS option has also been deprecated.
If the new default settings causes issues with your tests, you can use the TestRestTemplate.withRedirects(…) method to pick an alternative follow redirects strategy.
|
Tip
|
Check the configuration changelog for a complete overview of the changes in configuration. |
If an Executor bean is present, Spring Boot can now be configured to auto-configure an AsyncTaskExecutor anyway.
To do so, set the spring.task.execution.mode property to force.
When running in this mode, it makes sure that all integrations, including regular @Async processing uses the auto-configured executor,
unless an AsyncConfigurer bean is defined.
Spring Boot now auto-configures a bean named bootstrapExecutor if it’s not already there.
For that to work, there needs to be a bean named applicationTaskExecutor in the context, which is the default if you haven’t defined a custom Executor bean.
This enables bean background initialization out of the box.
Users of WebClient can now use properties for global configuration such as timeouts and redirect settings.
This feature aligns with the support that we added for blocking clients in Spring Boot 3.4.
For details, see the update reference documentation.
In addition to the new properties, the new ClientHttpConnectorBuilder interface can be used for more complex customizations.
As an annotation-based alternative to ServletRegistrationBean and FilterRegistrationBean two new annotations have been added.
@ServletRegistration can be used to register Servlet, while @FilterRegistration can be used to register Filter, as shown in this example:
@Configuration(proxyBeanMethods = false)
class MyConfiguration {
@Bean
@FilterRegistration(name = "my-filter", urlPatterns = "/test/*", order = 0)
MyFilter myFilter() {
return new MyFilter();
}
}Additionally, the behavior of FilterRegistrationBean for empty dispatcher types has been adjusted.
Previously, it was possible to pass an empty DispatcherType set into the setDispatcherTypes methods, and this empty set would be passed through to the server. Now it’s the same behavior as calling setDispatcherTypes(null), which aligns it to the FilterRegistration annotation.
OAuth 2 Client auto-configuration now applies in more situations and is more granular.
-
OAuth2ClientAutoConfigurationconfigure OAuth 2 client related beans in anything other than a reactive web application -
OAuth2ClientWebSecurityAutoConfigurationconfigures OAuth 2 client based web security in a servlet web application -
ReactiveOAuth2ClientAutoConfigurationconfigures reactive OAuth 2 client related beans in anything other than a servlet web application -
ReactiveOAuth2ClientWebSecurityAutoConfigurationconfigures OAuth 2 client based web security in a reactive web application
The default builder has been switched to paketobuildpacks/builder-noble-java-tiny.
The resulting image doesn’t have a shell or other utilities.
If you need a shell, you can use paketobuildpacks/ubuntu-noble-run-base as the run image.
Spring Boot 3.5.0-RC1 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:
-
MeterProviderbeans are now automatically configured onOtlpHttpLogRecordExporter,OtlpHttpSpanExporter,OtlpGrpcLogRecordExporterandOtlpGrpcSpanExporter. -
The
referralmode for Spring LDAP can be configured with the newspring.ldap.referralproperty. -
Customizers for
OtlpHttpSpanExporterBuilderandOtlpGrpcSpanExporterBuilderhave been added. -
The new property
spring.kafka.consumer.max-poll-intervalcan be used to configure Kafka’s maximum delay between poll invocations. -
RECORD_COMPONENThas been removed as a target from@DefaultValue, as it wasn’t really necessary. -
The auto-configured
RestClientSslbean now builds upon, rather than overwrite, the configuration fromHttpClientProperties. -
RestClientAutoConfigurationnow applies for reactive web applications that are using virtual threads and have aapplicationTaskExecutorbean. -
The Auto-configured
OtlpMeterRegistrynow applies any use providedOtlpMetricsSenderbean. -
It is now possible to set histogram-flavor and max-buckets per meter registry.
-
Additional properties have been added under
logging.structured.json.contextto allow context data to not be logged, or to be logged in a different location. -
A new
spring.test.print-condition-evaluation-reportproperty has been added that can be set tofalseif you don’t want the details printed when tests fail.
-
The configuration property
spring.mvc.converters.preferred-json-mapperhas been deprecated. It is replaced byspring.http.converters.preferred-json-mapper. -
The configuration properties
spring.codec.log-request-detailsandspring.codec.max-in-memory-sizehave been deprecated. They are replaced byspring.http.codecs.log-request-detailsandspring.http.codecs.max-in-memory-sizerespectively. -
org.springframework.boot.autoconfigure.security.oauth2.client.servlet.OAuth2ClientAutoConfigurationin favor oforg.springframework.boot.autoconfigure.security.oauth2.client.OAuth2ClientAutoConfiguration