What’s New in Spring Boot 3.4? 10 Key Features Explained
This article summarizes the major Spring Boot 3.4 enhancements, including RestClient auto‑configuration, refined Bean Validation for @ConfigurationProperties, default graceful shutdown, revamped Actuator endpoint access control, structured logging formats, @Fallback beans, a new ClientHttpRequestFactoryBuilder, additional logging properties, virtual‑thread support, and a host of miscellaneous improvements.
1. RestClient and RestTemplate
Spring Boot 3.4 adds auto‑configuration for RestClient and RestTemplate, supporting Reactor Netty HttpClient, JDK HttpClient, Apache HttpComponents, Jetty Client and Simple JDK HttpURLConnection. The client can be selected via spring.http.client.factory (values: http-components, jetty, reactor, jdk, simple).
2. Bean Validation for @ConfigurationProperties
Validation now follows the Bean Validation specification: it starts on the class annotated with @ConfigurationProperties and only cascades to nested properties when the field is annotated with @Valid. Add @Valid where you need nested validation.
3. Graceful Shutdown
Embedded web servers (Jetty, Reactor Netty, Tomcat, Undertow) now enable graceful shutdown by default. To revert to immediate shutdown set server.shutdown=immediate .
4. Actuator Endpoint Access Control
Endpoint enable/disable has been redesigned. Old properties management.endpoints.enabled-by-default and management.endpoint.<id>.enabled are deprecated. Use management.endpoints.access.default and management.endpoint.<id>.access . The new management.endpoints.access.max-permitted can limit the highest permitted level (e.g., read‑only).
5. Structured Logging
Support for structured logging with ECS, GELF and Logstash formats. Configure file output via logging.structured.format.file and console output via logging.structured.format.console .
6. @Fallback Beans
The @Fallback annotation can be used together with @ConditionalOnSingleCandidate to select a primary bean when present, otherwise fall back to the @Fallback bean.
<code>@Configuration
public class FallbackConfig {
@Bean
DAO a() { return new A(); }
@Bean
@Fallback
DAO b() { return new B(); }
@Bean
@ConditionalOnSingleCandidate(DAO.class)
Service service(DAO dao) {
System.err.println(dao);
return new Service(dao);
}
}
</code>7. ClientHttpRequestFactory Builder
A new ClientHttpRequestFactoryBuilder interface lets you build factories for specific client libraries (httpComponents(), jetty(), reactor(), jdk(), simple()). Configuration properties such as:
<code>spring:
http:
client:
factory: reactor
connect-timeout: 10000
read-timeout: 10000
redirects: follow-when-possible
</code>are used to create the appropriate factory automatically.
8. New Logging Properties
The spring.application.group property can group applications and be included in log messages via logging.include-application-group . Example configuration is shown in the article.
9. Virtual Threads
When virtual threads are enabled, components such as OtlpMeterRegistry and the Undertow web server run on virtual threads.
10. Miscellaneous Improvements
Numerous minor enhancements: custom Liquibase, JCache, view name translator, Lettuce client options, R2DBC proxy connection factory, Spring Security logout audit events, new TLS properties for JavaMailSender, GSON strictness, @Name annotation for configuration properties, DataSourceBuilder driver detection, health probes on Cloud Foundry, spring.application.version , EntityManagerFactoryBuilder native properties, virtual‑thread support for TaskScheduler, new endpoint aliases, pageable serialization mode, additional OTLP logging/tracing timeouts, SBOM detection, ClickHouse JDBC support, logging export toggles, custom BatchTaskExecutor, Spring Session repository indexing, Hikari checkpoint warnings, and many other tweaks.
Spring Full-Stack Practical Cases
Full-stack Java development with Vue 2/3 front-end suite; hands-on examples and source code analysis for Spring, Spring Boot 2/3, and Spring Cloud.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.