PrepZone Logo
PrepZone
Back to Spring Boot

Spring Boot · Medium

How do you configure graceful shutdown in Spring Boot applications?

Spring BootActuator & ObservabilityProduction ReadinessSeniorStaffArchitect

Answer preview

What graceful shutdown does: Marks the readiness probe as DOWN — Kubernetes stops routing new traffic to this pod Waits for in-flight requests to complete (up to the timeout) Closes database connections, Kafka consumers, thread pools cleanly Runs @PreDestroy methods and Spring c…