Sitemap
Boot Camp Java

Practical, production-ready Java and Spring Boot guides. Skip the dense theory and learn how to build, scale, and deploy enterprise applications with minimal boilerplate and maximum efficiency.

Member-only story

15 Spring Boot 4 Features That Feel Like Easter Eggs

--

A readiness switch that turns a pod’s probe to 503 without touching liveness, an exit code your batch job can return, and a virtual-thread app that quietly exits after one tick. Fifteen hidden Spring Boot 4 features, with real output.

Press enter or click to view image in full size
Fifteen glowing eggs sorted into four baskets: configuration, startup, running in production, and shutdown and tests. Each egg carries the property or class that unlocks it.

I put SPRING_APPLICATION_JSON='{"eggs":{"from-json":"hello"}}' in front of a Spring Boot 4.0.7 app with no config file for that key, and env.getProperty("eggs.from-json") came back as hello. No code, no profile, no extra dependency. The feature has been in Spring Boot for years.

Spring Boot has a lot of these: small features that are documented, stable and useful, and that most teams never find because nobody goes looking. We tend to think we know a framework once we have shipped a few services with it. We usually know the 20% we needed on the first day. The rule for this list: every item had to run on Spring Boot 4.0.7 and Java 25 in a small probe project, and the output under each item is what it printed. If it did not run, it is not here.

The short version:

  • AvailabilityChangeEvent.publish(ctx, ReadinessState.REFUSING_TRAFFIC) turned /actuator/health/readiness from 200 UP to 503 OUT_OF_SERVICE, while liveness stayed 200 UP.
  • A configuration value of 10MB binds to 10,485,760 bytes, and retention: 7 with @DurationUnit(DAYS)…

--

--

Full stack Developer, Architect, Lead , Agile

See more from me

Boot Camp Java
Boot Camp Java

Published in Boot Camp Java

Practical, production-ready Java and Spring Boot guides. Skip the dense theory and learn how to build, scale, and deploy enterprise applications with minimal boilerplate and maximum efficiency.