Skip to content

SYSTEM Cited by 1 source

Spring Boot

Spring Boot is the opinionated Spring framework distribution for JVM microservices. Spring Boot 3 (late 2022) requires Java 17+; its default servlet container is embedded Tomcat serving REST endpoints. Observability defaults route span data through Micrometer Tracing.

Relevance to the Netflix 2024-07-29 incident

Netflix's Java 21 migration fleet is on Spring Boot 3 + embedded Tomcat + Micrometer Tracing with Brave bridge + Zipkin Reporter. Spring Boot 3 makes enabling virtual threads a one-line config change — which also silently enables the VT-pinning failure mode on every code path that transits synchronized blocks containing blocking calls (including the default tracing path through brave.RealSpan.finish). The stack composition is load-bearing for the bug: each component is individually reasonable, but they compose into the starvation deadlock Netflix documented.

@DynamicPropertySource as the canonical Testcontainers wiring

Spring Framework 5.2.5 (shipped with Spring Boot 2.2.5, March 2020) introduced org.springframework.test.context.DynamicPropertySource, a test-context extension designed specifically to wire dynamic values — like the random JDBC URL or port that a Testcontainers-managed container only knows after .start() — into a Spring @Test context.

Idiom ():

@DynamicPropertySource
static void postgresqlProperties(DynamicPropertyRegistry r) {
    r.add("spring.datasource.url", postgreSQL::getJdbcUrl);
    r.add("spring.datasource.username", postgreSQL::getUsername);
    r.add("spring.datasource.password", postgreSQL::getPassword);
}

r.add(...) accepts a Supplier<?> (method reference above), so the value is computed lazily at context-creation time, after the container has booted. Pre-5.2.5, the equivalent required an ApplicationContextInitializer with a TestPropertyValues.applyTo(...) call — more verbose, more boilerplate per container.

The pairing @SpringBootTest(webEnvironment = RANDOM_PORT) + @ActiveProfiles("test") + @DynamicPropertySource is the canonical Spring Boot 3 + JUnit 5 + Testcontainers integration test shape.

Seen in

  • sources/2024-07-29-netflix-java-21-virtual-threads-dude-wheres-my-lock — The canonical wiki instance of a Spring Boot 3 + Java 21 + VT stack hanging under carrier-thread exhaustion from VT pinning inside Micrometer Tracing's Brave bridge.
  • — Zalando ZMS's Java/Spring Boot / JUnit 5 / Testcontainers integration-test idiom; canonicalises @DynamicPropertySource as the Testcontainers-wiring primitive in Spring Boot.
  • — Spring Boot named as the default framework for new Kotlin backend services at Zalando, following Kotlin's TRIAL → ADOPT promotion on the Tech Radar. Three rationales given: large adoption base, official Spring-Kotlin integration guide, multi-application-server
  • reactive WebFlux support. Ktor flagged as upcoming ASSESS-ring alternative (possibly with GraalVM) but Spring Boot retained as default. Stack slate paired with Spring Boot: Gradle (Kotlin DSL), Ktlint, kotlin-logging, Lettuce for Redis, Spring Data JPA / jOOQ for RDBMS, opentracing-toolbox for tracing, OpenAPI + Zally for API-first, Skipper / Fabric Gateway for AuthN/AuthZ.
Last updated · 542 distilled / 1,571 read