What Is New in Spring Boot 2.6
Spring Boot 2.6 delivers a substantial update with new capabilities, dependency upgrades, and refinements to existing features. This version builds on the mature foundation while introducing thoughtful changes for modern application development.
| Category | Key Changes |
|---|---|
| New Features | Docker Compose support, Spring GraphQL integration, JUnit 5.8 support, new Actuator endpoints |
| Improvements | Enhanced metrics, OAuth2 client configuration, Spring MVC path pattern matching |
| Deprecations | Legacy configuration properties, older Spring Security OAuth support |
| Dependency Upgrades | Spring Framework 5.3.13, Spring Data 2021.1, Spring Security 5.6 |
How does Spring Boot 2.6 improve developer experience?
This release introduces first-class support for Docker Compose, significantly streamlining local development workflows. You can now automatically start and stop services defined in a compose.yaml file when your application runs.
Support for Spring GraphQL means you can now build GraphQL APIs with auto-configuration for GraphQL over HTTP and WebSocket endpoints. The actuator also gets new /graphql endpoints for monitoring your GraphQL infrastructure.
For testing, JUnit 5.8 is now supported, providing access to the latest features and improvements in the JUnit platform.
What are the key changes to metrics and observability?
Metrics collection saw major refinements. The DiskSpaceHealthIndicator now uses a configurable path instead of just the working directory, which is far more practical for monitoring specific volumes.
HTTP server metrics now use the new path pattern parser by default when available, providing more precise and efficient metric tagging for MVC and WebFlux applications. This change helps avoid metric cardinality issues from URI variables.
The actuator's /info endpoint now includes Java vendor information by default, giving you immediate runtime environment details without extra configuration.
How does security configuration evolve in this release?
OAuth2 client configuration becomes more flexible with support for multiple JWT issuers. You can now configure different issuers for different clients, which matches real-world deployment scenarios where services authenticate against different authorities.
The auto-configuration for Spring Security's OAuth2 client now backs off when using WebFlux without Servlet, preventing unnecessary configuration conflicts in reactive applications.
Legacy Spring Security OAuth support continues its deprecation path, pushing developers toward the current OAuth2 implementation that's now part of Spring Security proper.
What configuration changes should developers watch for?
Several property changes require attention. The spring.data.cassandra.* properties now consistently use seconds for duration values instead of milliseconds, aligning with other data-related properties.
Path matching strategy for Spring MVC defaults to the parsed pattern-based approach instead of Ant path matcher. This offers better performance and more precise matching, though you can revert to the Ant matcher if needed.
Properties that were deprecated in previous releases have been removed, so check your configuration for any usage of older property names that might need updating.
FAQ
How do I enable Docker Compose support in my Spring Boot 2.6 application?
Add spring-boot-docker-compose to your dependencies. Place a compose.yaml file in your project root, and Spring Boot will automatically start the services when your application runs and stop them when it shuts down.
Does Spring Boot 2.6 support GraphQL subscriptions?
Yes, the new Spring GraphQL auto-configuration includes support for GraphQL over WebSocket, which enables subscription functionality alongside query and mutation operations.
Why are my Cassandra duration properties not working after upgrading?
Spring Boot 2.6 changed spring.data.cassandra.* duration properties from milliseconds to seconds. Update your configuration values accordingly by dividing them by 1000.
How can I revert to the Ant path matcher if the new pattern parser causes issues?
Set spring.mvc.pathmatch.matching-strategy=ant-path-matcher in your application properties to restore the previous path matching behavior.
What happened to the spring.security.oauth2.client auto-configuration for WebFlux?
The auto-configuration now backs off when using WebFlux without Servlet, preventing configuration conflicts. For pure reactive applications, you'll need to configure your OAuth2 client manually.