Spring Boot 3.5 Release: Top 13 New Features You Must Know
Spring Boot 3.5 introduces a suite of powerful enhancements—including task decorator support, a new Vibur connection pool, SSL monitoring, flexible environment variable loading, Actuator-triggered Quartz jobs, automatic Trace ID headers, structured log customization, functional routing insights, expanded SSL client support, OpenTelemetry upgrades, Spring Batch tweaks, OAuth 2.0 JWT profiling, and functional bean registration—providing developers with richer capabilities for modern Java backend applications.
Spring Boot 3.5 is scheduled for release this month, bringing many noteworthy enhancements.
Task scheduling enhancements : TaskDecorator automatically applied to all scheduled tasks.
Vibur connection pool : High‑performance database connection pool option.
Security monitoring upgrade : SSL certificate status visible.
Configuration management improvements : More flexible handling of environment variables and configuration.
Link tracing improvement : Trace ID automatically written to HTTP response headers.
Actuator experience boost : Comprehensive Actuator feature enhancements.
Functional programming support : Early access to Spring Framework 7 features.
New Feature Details
1. TaskDecorator: More powerful scheduled tasks
Spring Boot 3.5 now automatically applies any TaskDecorator bean in the application context to all scheduled task executors.
<code>@Bean
public TaskDecorator myTaskDecorator() {
return taskDecorator -> {
// Get main thread context information
String userId = UserContext.getCurrentUserId();
// Return wrapped task
return () -> {
// Set context in child thread
...
};
};
}
</code>No need to write repetitive boilerplate; security context and MDC logging information are passed effortlessly, which is especially useful for multi‑tenant contexts and unified permissions.
2. Vibur connection pool: New high‑performance option
In addition to HikariCP, Tomcat, Dbcp2 and OracleUcp, Spring Boot 3.5 adds support for the Vibur DBCP connection pool.
<code>spring:
datasource:
type: io.vibur.dbcp.ViburDBCPDataSource
</code>Vibur DBCP offers advanced performance monitoring, slow‑SQL detection, thread‑hunger prevention, and JDBC statement caching, suitable for applications with strict database performance requirements.
3. SSL Bundle metrics: Clear security monitoring
Actuator now provides health metrics for SSL certificate chains, categorizing them as valid, expired, soon‑to‑expire, or not yet valid.
<code>management:
endpoints:
web:
exposure:
include: health,info,ssl
ssl:
bundles:
enabled: true
</code>Operations teams can monitor SSL certificate status in real time and avoid service interruptions caused by expired certificates.
4. Environment variable configuration loading
Spring Boot 3.5 allows loading multiple configuration properties from a single environment variable, simplifying containerized deployments.
<code># In application.yml
spring:
config:
import: env:MY_CONFIGURATION
</code> <code># Set environment variable
MY_CONFIGURATION='
datasource.url=jdbc:mysql://prod-db:3306/myapp
datasource.username=prod_user
datasource.password=prod_password
'
</code>In Docker and Kubernetes, a single environment variable can convey many configuration items, avoiding the need for separate variables for each property.
5. Actuator‑triggered Quartz jobs
You can now trigger Quartz jobs via an HTTP endpoint without waiting for the scheduled time.
<code>curl -X POST http://localhost:8080/actuator/quartz/jobs/DEFAULT/syncDataJob
</code>Operations personnel can manually start scheduled tasks with a simple request, greatly improving response speed in emergencies.
6. HTTP response header Trace ID
When integrated with Micrometer Observations and Tracing, the Trace ID is automatically written to HTTP response headers.
<code>management:
observations:
http:
server:
requests:
write-trace-header: true
</code>Front‑end services can directly obtain the Trace ID for issue reporting, enhancing end‑to‑end fault‑diagnosis efficiency.
7. Structured log stack‑trace customization
Spring Boot 3.5 allows customizing the stack‑trace output in structured JSON logs.
<code>logging:
structured:
json:
stacktrace:
max-depth: 20
packaged-only: true
include-packages: com.mycompany
exclude-packages: org.springframework,java.lang
</code>Only business‑code stack frames are emitted, filtering out framework code for clearer logs and more precise problem location.
8. WebMvc functional routing information
The Mappings endpoint now includes detailed information about WebMvc.fn functional routes.
<code>@Bean
public RouterFunction<ServerResponse> routerFunction() {
return route()
.GET("/api/users", this::getAllUsers)
.POST("/api/users", this::createUser)
.build();
}
</code>9. Service connection SSL support
Client‑side SSL support is added for various service connections, including Cassandra, Couchbase, Elasticsearch, Kafka, MongoDB, RabbitMQ, and Redis.
<code>spring:
data:
mongodb:
ssl:
enabled: true
bundle: mongodb-bundle
bundles:
mongodb-bundle:
keystore:
location: classpath:mongodb-keystore.p12
password: secret
type: PKCS12
</code>This simplifies secure communication with backend services, meeting compliance requirements.
10. OpenTelemetry improvements
Support for configuring OpenTelemetry resource attributes via properties or environment variables, including the new service.namespace attribute.
<code>management:
tracing:
opentelemetry:
resource:
attributes:
service.name: my-service
service.namespace: my-group
export:
otlp:
endpoint: http://tempo:4317
</code>11. Spring Batch enhancements
Custom JobParametersConverter can be defined, and transaction‑state validation can be controlled.
<code>@Bean
public JobParametersConverter customJobParametersConverter() {
return new MyCustomJobParametersConverter();
}
spring:
batch:
jdbc:
validate-transaction-state: false
</code>Provides more flexible batch job parameter handling for complex scenarios.
12. OAuth 2.0 JWT Profile
Spring Security 6.5.0 adds support for RFC 9068, standardizing the JWT format of OAuth 2.0 access tokens.
<code>@Bean
public JwtEncoder jwtEncoder() {
return new NimbusJwtEncoder(jwkSource());
}
@Bean
public OAuth2TokenCustomizer<JwtEncodingContext> jwtCustomizer() {
return context -> {
JwtClaimsSet.Builder claims = context.getClaims();
claims.claim("client_id", context.getRegisteredClient().getClientId());
// other RFC 9068 required claims
};
}
</code>Improves interoperability and security of OAuth 2.0 tokens.
13. Functional Bean registration
BeanRegistrar interface enables functional bean registration, previewing Spring Framework 7 capabilities.
<code>public class MyBeanRegistrar implements BeanRegistrar {
@Override
public void registerBeans(BeanRegistry registry, Environment environment) {
if (environment.containsProperty("feature.enabled")) {
registry.registerBean(MyService.class, MyService::new);
}
}
}
@Import(MyBeanRegistrar.class)
@Configuration
public class AppConfig {
// ...
}
</code>Allows dynamic bean registration based on runtime conditions, offering more flexibility than @Conditional.
Java Architecture Diary
Committed to sharing original, high‑quality technical articles; no fluff or promotional content.
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.