Originally published on The Trail by Grupa VII.
You copy a documented property straight from the Spring Boot reference guide into application.yml. Your IDE autocompletes it. The application boots cleanly with zero errors and zero warnings.
And the setting does absolutely nothing.
I learned that lesson the hard way during a real production outage on a peer-to-peer RSocket mesh (detailed in The Trail That Went Cold). Dashboards were green, heartbeats were flowing, and customer data had quietly stopped arriving. Buried in DEBUG logs sat RSocket's hard 16 MB frame limit (16,777,215 bytes). I added spring.rsocket.server.fragment-size: 1MB, deployed, and woke up to the exact same outage.
Opening RSocketServerAutoConfiguration exposed why. RSocketProperties parsed and bound fragment-size cleanly, yet the wiring lived inside EmbeddedServerConfiguration, gated by @ConditionalOnProperty("spring.rsocket.server.port"). Because our service ran RSocket over WebFlux WebSockets on the shared HTTP port, that nested configuration never loaded and the bound property sat orphaned in memory until a programmatic RSocketServerCustomizer replaced it.
Once you see that pattern in RSocket, you start spotting it everywhere across Spring Boot.
The Structural Gap: Property Binding vs. Condition Evaluation
Spring Boot's auto-configuration engine runs two largely independent pipelines during startup:
Property binding answers one question: is this YAML syntactically valid for a bound properties class? Condition evaluation answers a completely different question: should this auto-configuration class or @Bean method participate in the current application context?
Because those two systems have no coupling, Spring Boot emits no warning when a property binds cleanly to a *Properties bean (or sits in the Environment) while the specific @Bean method responsible for reading it backs off due to an unmet @Conditional* annotation.
What Changed in Spring Boot 4.0 (And Added a New Silent Failure Mode)
Spring Boot 4.0 broke the monolithic spring-boot-autoconfigure JAR into focused technology modules (spring-boot-jdbc, spring-boot-cache, spring-boot-kafka, spring-boot-security, spring-boot-rsocket), moved classes into org.springframework.boot.<technology>.autoconfigure, and made top-level auto-configuration classes public final (including org.springframework.boot.rsocket.autoconfigure.RSocketServerAutoConfiguration).
That modularization is a welcome cleanup, yet it introduces an extra silent trap during migrations. In Spring Boot 3.x, dropping a library like spring-kafka onto the classpath often triggered auto-configuration automatically because every @AutoConfiguration lived inside one giant JAR. In Spring Boot 4.0, bringing in a raw library without its dedicated Spring Boot module (or omitting the new spring-boot-starter-*-test modules in slice tests) means the auto-configuration class is simply absent. Your YAML stays valid, startup stays green, and nothing wires it up.
Four Silent @Conditional Traps (Ordered by Blast Radius)
RSocket was only the entry point. Across enterprise services, the exact same decoupling escalates from slow memory leaks and pool exhaustion to dropped virtual-thread consumers and silently skipped security chains.
Trap 1: Caching Silently Falling Back to an Unbounded ConcurrentHashMap
You add @EnableCaching and configure Caffeine or Redis TTLs in application.yml. Production boots cleanly, yet memory climbs steadily per pod and pods serve stale entries to different users.
spring: cache: caffeine: spec: maximumSize=10000,expireAfterWrite=5m In Spring Boot 4.0, org.springframework.boot.cache.autoconfigure.CacheAutoConfiguration imports candidate cache configurations in a fixed order via CacheConfigurationImportSelector, with SimpleCacheConfiguration sitting at the bottom of the fallback chain:
@Configuration(proxyBeanMethods = false) @ConditionalOnMissingBean(CacheManager.class) @Conditional(CacheCondition.class) class SimpleCacheConfiguration { @Bean ConcurrentMapCacheManager cacheManager(CacheProperties cacheProperties, CacheManagerCustomizers cacheManagerCustomizers) { ConcurrentMapCacheManager cacheManager = new ConcurrentMapCacheManager(); // ... } } If com.github.benmanes.caffeine.cache.Caffeine is missing from the classpath and spring.cache.type stays on default auto-detection, CaffeineCacheConfiguration quietly fails @ConditionalOnClass. Similarly, omitting the spring-boot-data-redis module in Boot 4.0 means DataRedisAutoConfiguration never creates a RedisConnectionFactory, so RedisCacheConfiguration quietly fails @ConditionalOnBean(RedisConnectionFactory.class).
In both cases, SimpleCacheConfiguration wins as the fallback and registers a ConcurrentMapCacheManager. Your spring.cache.caffeine.spec binds cleanly with zero warnings while production runs on an unbounded, per-pod ConcurrentHashMap with no TTL, no size eviction, and no cross-pod invalidation.
The deterministic fix: Always pin spring.cache.type explicitly (caffeine or redis). When the expected provider is missing, CacheManagerValidator fails fast at startup with an IllegalArgumentException (wrapped in BeanCreationException: "No cache manager could be auto-configured, check your configuration").
Trap 2: DataSource Pool Tuning Silently Dropping Back to 10 Connections
Everything runs smoothly until a team adds a second DataSource bean (a read replica, reporting DB, or dedicated outbox pool) or writes a custom @Bean DataSource for credential rotation. At peak load, connection timeouts spike because the primary pool quietly reverted to Hikari's 10-connection default.
Inside Spring Boot 4.0's org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration, PooledDataSourceConfiguration imports DataSourceConfiguration.Hikari, guarded by @ConditionalOnMissingBean(DataSource.class):
@Configuration(proxyBeanMethods = false) @ConditionalOnClass(HikariDataSource.class) @ConditionalOnMissingBean(DataSource.class) @ConditionalOnProperty( name = "spring.datasource.type", havingValue = "com.zaxxer.hikari.HikariDataSource", matchIfMissing = true ) static class Hikari { @Bean @ConfigurationProperties("spring.datasource.hikari") HikariDataSource dataSource(DataSourceProperties properties, JdbcConnectionDetails connectionDetails, Environment environment) { // ... } } The instant any DataSource bean exists in the context, DataSourceConfiguration.Hikari backs off completely. Because @ConfigurationProperties("spring.datasource.hikari") is attached to that skipped @Bean method, every Hikari tuning setting in application.yml (maximum-pool-size, connection-timeout, max-lifetime, leak-detection-threshold) is silently dropped unless you manually bind it onto your custom HikariDataSource.
The deterministic fix: For an auxiliary read-only or reporting DataSource alongside the primary pool, mark the secondary bean @Bean(defaultCandidate = false) so primary auto-configuration stays active. When defining a custom primary DataSource, bind properties explicitly via @ConfigurationProperties("app.datasource.primary.hikari") on your @Bean method and assert live HikariDataSource.getMaximumPoolSize() in a startup test.
Trap 3: Kafka Listener Concurrency and Virtual Threads Quietly Bypassed
An engineer tunes spring.kafka.listener.concurrency, ack-mode, and virtual threads in application.yml, yet consumers stay single-threaded and miss observation tags under peak queue lag.
In Spring Boot 4.0, Kafka auto-configuration lives in spring-boot-kafka under org.springframework.boot.kafka.autoconfigure.KafkaAutoConfiguration (@ConditionalOnClass(KafkaTemplate.class)) and KafkaAnnotationDrivenConfiguration (@ConditionalOnClass(EnableKafka.class)). Two separate paths trigger the exact same silence:
- Missing Boot 4 module or
@EnableKafka: Declaring a direct dependency onorg.springframework.kafka:spring-kafkawithoutspring-boot-starter-kafka(orspring-boot-kafka) meansKafkaAutoConfigurationnever loads at all; missingEnableKafkasilently skipsKafkaAnnotationDrivenConfiguration. - Custom factory back-off:
KafkaAutoConfigurationguardskafkaConsumerFactorywith@ConditionalOnMissingBean(ConsumerFactory.class), andKafkaAnnotationDrivenConfigurationguardskafkaListenerContainerFactorywith@ConditionalOnMissingBean(name = "kafkaListenerContainerFactory"). Defining a customConcurrentKafkaListenerContainerFactorybean (say, for a custom error handler) without injecting Spring Boot'sConcurrentKafkaListenerContainerFactoryConfigurerbypasses everyspring.kafka.listener.*YAML setting (concurrency,ack-mode, observation flags) and silently drops Boot 4.0's@ConditionalOnThreading(Threading.VIRTUAL)executor wiring.
The deterministic fix: Customize through DefaultKafkaConsumerFactoryCustomizer, ContainerCustomizer, or by injecting ConcurrentKafkaListenerContainerFactoryConfigurer into your custom factory rather than constructing a bare ConcurrentKafkaListenerContainerFactory.
Trap 4: Servlet Security Chains Silently Skipped in WebFlux
The highest blast radius sits in security. An organization reuses a shared internal security starter built around servlet primitives (HttpSecurity, SecurityFilterChain, OncePerRequestFilter) inside a reactive WebFlux service. Startup is green, yet the custom servlet filter chain never registers.
In Spring Boot 4.0, servlet web security moved out of SecurityAutoConfiguration into org.springframework.boot.security.autoconfigure.web.servlet.ServletWebSecurityAutoConfiguration:
@AutoConfiguration(after = UserDetailsServiceAutoConfiguration.class, ...) @ConditionalOnClass(EnableWebSecurity.class) @ConditionalOnWebApplication(type = Type.SERVLET) public final class ServletWebSecurityAutoConfiguration { ... } Once the service boots as WebApplicationType.REACTIVE, ServletWebSecurityAutoConfiguration evaluates to a clean negative match, silently skipping any @Configuration or filter chain conditioned on Type.SERVLET.
Boot 4.0 adds a second wrinkle for legacy exclude lists: org.springframework.boot.security.autoconfigure.SecurityAutoConfiguration now only wires core properties and event publishing, while the default servlet chain moved to ServletWebSecurityAutoConfiguration and user defaults sit in UserDetailsServiceAutoConfiguration. Carrying a Boot 3 exclude list as-is either crashes startup with a missing SecurityProperties dependency in UserDetailsServiceAutoConfiguration, or leaves ServletWebSecurityAutoConfiguration wiring the default filter chain anyway.
The deterministic fix: Never assume a shared security starter covers both Servlet and WebFlux services. In reactive services, assert that a SecurityWebFilterChain bean (never a servlet SecurityFilterChain) is registered and enforces auth on every non-public route.
Quick Reference: Four Traps at a Glance
| Trap | Silent Production Symptom | Condition That Backed Off | Fail-Fast Guard |
|---|---|---|---|
| Cache | Unbounded per-pod ConcurrentHashMap, stale reads | @ConditionalOnClass / @ConditionalOnBean(RedisConnectionFactory) -> SimpleCacheConfiguration | Pin spring.cache.type explicitly |
| DataSource | Hikari silently reverts to 10 connections | @ConditionalOnMissingBean(DataSource.class) | @Bean(defaultCandidate = false) or explicit @ConfigurationProperties + test |
| Kafka | spring.kafka.listener.* & virtual threads ignored | Missing spring-boot-kafka or @ConditionalOnMissingBean(name = "kafkaListenerContainerFactory") | Use customizers or inject ConcurrentKafkaListenerContainerFactoryConfigurer |
| Security | Custom servlet filter chain never runs in WebFlux | @ConditionalOnWebApplication(type = Type.SERVLET) | Assert live SecurityWebFilterChain + route auth test |
Rule of thumb: Whenever you define a manual
@Beanfor a framework-managed infrastructure type (DataSource,CacheManager,ConsumerFactory,SecurityFilterChain), assume you just turned off Spring Boot's YAML binding for that subsystem until a test proves otherwise.
The Toolkit: Verify the Bean, Read Negative Matches, Lock It in CI
You do not need to memorize hundreds of auto-configuration classes. Whenever a Spring Boot 4 service behaves as if your application.yml does not exist, work through four checks in order: read negative matches locally, inspect /actuator/conditions in running environments, trace edge cases in SpringBootCondition, and lock the live bean contract in CI.
1. Boot With --debug and Read ConditionEvaluationReport
Start the service locally with --debug (or debug: true in a temporary profile). Spring Boot prints the CONDITIONS EVALUATION REPORT split into Positive matches and Negative matches.
Skip the positive matches first. Search directly for the subsystem you configured (RSocketServerAutoConfiguration, SimpleCacheConfiguration, DataSourceAutoConfiguration.PooledDataSourceConfiguration, KafkaAnnotationDrivenConfiguration) inside Negative matches. Within 60 seconds, Spring tells you the exact annotation and reason it backed off, for example:
DataSourceAutoConfiguration.PooledDataSourceConfiguration: Did not match: - @ConditionalOnMissingBean (types: javax.sql.DataSource; SearchStrategy: all) found beans of type 'javax.sql.DataSource' reportingDataSource (OnBeanCondition) One nuance worth knowing in Spring Boot 4.0: an @Import-ed nested class like DataSourceConfiguration.Hikari can still appear in parse-phase positive matches even when its importing parent (PooledDataSourceConfiguration) backs off during bean registration and registers zero beans. Always check the parent configuration and the live bean instance, not just the nested class name.
2. Inspect /actuator/conditions in Running Environments
Local profiles often differ from staging and production (different Cloud/Vault properties, extra agents, different starters). When management.endpoints.web.exposure.include exposes conditions on an internal management port, hitting GET /actuator/conditions returns the live ConditionEvaluationReport as JSON for the exact running artifact. Diffing /actuator/conditions between staging and production catches environment-specific condition flips in minutes.
3. Set Strategic Breakpoints in SpringBootCondition
When a custom condition or nested condition (AllNestedConditions, AnyNestedCondition) still surprises you, put a conditional breakpoint inside org.springframework.boot.autoconfigure.condition.OnPropertyCondition.getMatchOutcome(...) or OnBeanCondition.getMatchOutcome(...) filtered on the target metadata class name. Stepping through getMatchOutcome shows the exact Environment view and bean registry state at the moment Spring made its decision.
4. Pin Critical Infrastructure Assumptions in Automated Tests
Manual debugging fixes today's outage. Automated tests prevent the next refactor (or an AI-generated @Configuration class, as covered in Teaching the Trail) from silently breaking the same contract six months later.
Use ApplicationContextRunner for fast, isolated verification of shared auto-configuration modules, and add a focused @SpringBootTest startup assertion verifying the effective runtime bean types and applied property values on your real service:
@SpringBootTest @TestConstructor(autowireMode = TestConstructor.AutowireMode.ALL) class InfrastructureContractTest( private val cacheManager: CacheManager, private val dataSource: DataSource, ) { @Test fun `production cache must not silently fall back to unbounded ConcurrentMapCacheManager`() { assertThat(cacheManager) .isNotInstanceOf(ConcurrentMapCacheManager::class.java) } @Test fun `hikari pool size from application yaml must actually be applied`() { assertThat(dataSource).isInstanceOfSatisfying(HikariDataSource::class.java) { hikari -> assertThat(hikari.maximumPoolSize).isEqualTo(25) assertThat(hikari.connectionTimeout).isEqualTo(5_000L) } } } That short startup test catches the moment someone adds a secondary DataSource bean or drops a cache dependency in build.gradle.kts, turning a silent production regression into an immediate red build in CI.
What to check: Pick the five most dangerous lines in your production
application.yml(pool sizes, cache TTL, security mode, Kafka concurrency, frame or payload limits). If you changed each one to an obviously different value, would any test in CI notice if Spring Boot silently ignored it?
The Trade-Offs (And What Spring Boot Could Do Better)
Spring Boot's @Conditional* design is why the framework can boot everything from a tiny CLI worker to a reactive WebFlux gateway with minimal boilerplate. Backing off cleanly when a user supplies a custom @Bean is a feature, and hard-failing every time an unused property appears in a shared ConfigMap would break legitimate multi-profile deployments.
Still, there is a middle ground Spring Boot lacks today: an opt-in startup diagnostic (or WARN-level check) flagging properties bound to an active *Properties class whose corresponding auto-configured consumer backed off. Until the framework ships that safety net, engineering teams own closing the gap themselves. We packaged executable Spring Boot 4.0 proofs for these traps, a /actuator/conditions diff CLI (plus Gradle and Maven plugins), and that exact opt-in startup guard in the open-source companion repository github.com/grupavii/boot-truth.
What CTOs Should Mandate Before a Spring Boot 3-to-4 Cutover
For CTOs and VPs of Engineering overseeing a fleet-wide Spring Boot 3-to-4 migration, the organizational takeaway is blunt: a green build and clean startup logs no longer prove a service migrated safely. Because Boot 4 splits auto-configuration into fine-grained modules, missing a single starter can silently degrade caching, security, or connection pooling without throwing an error. Mandate three gates before production cutover:
- Require a startup contract test (
InfrastructureContractTest) in every shared service template verifying liveDataSource,CacheManager, security, and messaging bean types. - Diff
/actuator/conditionsbetween Spring Boot 3 and Spring Boot 4 builds in staging before promoting any revenue-critical service. - Pin explicit provider properties (like
spring.cache.type) so missing modules fail fast at boot instead of degrading quietly under load.
In Part 2 of this series, we walk through the exact Spring Boot 3-to-4 migration traps caused by modularization (SecurityAutoConfiguration splits, slice-test starters, and spring-boot-autoconfigure-classic) and how to catch them with a before-and-after /actuator/conditions diff.
Spring Boot is remarkably predictable once you stop treating application.yml as an imperative script and start treating it as input to a conditional state machine. Verify the beans that actually boot, and the trail never goes cold twice.
Upgrading to Spring Boot 4 or hunting silent reliability bottlenecks in JVM services? A fixed-scope 2-Week Architecture Review audits your runtime wiring, configuration contracts, and legacy modernization risk in code before they surface in production, or share one architectural bottleneck via the contact form for three candid observations within 48 hours.

