Tag

SmartLifecycle

0 views collected around this technical thread.

Cognitive Technology Team
Cognitive Technology Team
Oct 15, 2023 · Backend Development

How to Implement Pre‑warming in the Spring Ecosystem: Extension Points and Their Execution Order

Implementing pre‑warming in Spring involves using several extension points—SmartLifecycle, ApplicationListener for ContextRefreshedEvent, InitializingBean, @PostConstruct, ApplicationRunner, and CommandLineRunner—each with specific execution timing and ordering considerations to ensure cache loading occurs before the web server starts handling traffic.

ApplicationListenerApplicationRunnerCache
0 likes · 4 min read
How to Implement Pre‑warming in the Spring Ecosystem: Extension Points and Their Execution Order
政采云技术
政采云技术
Feb 16, 2023 · Backend Development

Graceful Shutdown Support in Spring Boot 2.3+ for Embedded Web Servers

Since Spring Boot 2.3.0.RELEASE, graceful shutdown is supported for all embedded web servers (Jetty, Reactor Netty, Tomcat, Undertow) and both reactive and servlet‑based applications, using SmartLifecycle beans, configurable timeouts, and a JVM shutdown hook to allow in‑flight requests to finish while refusing new ones.

BackendEmbeddedWebServerGracefulShutdown
0 likes · 10 min read
Graceful Shutdown Support in Spring Boot 2.3+ for Embedded Web Servers
政采云技术
政采云技术
Feb 16, 2023 · Backend Development

Graceful Shutdown Support in Spring Boot 2.3+ for Embedded Web Servers

Spring Boot 2.3.0.RELEASE adds graceful shutdown for all embedded web servers, explaining the underlying SmartLifecycle mechanism, configuration steps, shutdown hook registration, and how timeout handling ensures existing requests finish while new requests are rejected.

Embedded Web ServerGraceful ShutdownJava
0 likes · 11 min read
Graceful Shutdown Support in Spring Boot 2.3+ for Embedded Web Servers
Cognitive Technology Team
Cognitive Technology Team
May 20, 2022 · Backend Development

Implementing Business Data Pre‑warming in Spring Using SmartLifecycle and ContextRefreshedEvent

To pre‑warm business data before a Spring web service accepts requests, the article explains two approaches—implementing the SmartLifecycle interface with proper phase ordering and using a ContextRefreshedEvent listener—while highlighting code examples, execution timing, and cautions against asynchronous overrides.

BackendContextRefreshedEventJava
0 likes · 7 min read
Implementing Business Data Pre‑warming in Spring Using SmartLifecycle and ContextRefreshedEvent
Full-Stack Internet Architecture
Full-Stack Internet Architecture
May 8, 2021 · Backend Development

Graceful Shutdown of RocketMQ Consumer in Spring Applications

The article recounts a production incident caused by an ungraceful RocketMQ consumer shutdown, analyzes the root cause involving Spring's bean destruction order and ShutdownHook behavior, and presents two solutions—using the official Spring‑Boot starter with SmartLifecycle or handling ContextClosedEvent—to achieve orderly termination.

BackendGraceful ShutdownShutdownHook
0 likes · 5 min read
Graceful Shutdown of RocketMQ Consumer in Spring Applications