Tagged articles
11 articles
Page 1 of 1
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Sep 28, 2025 · Backend Development

Master Spring Boot 3 Bean Lifecycle: @PostConstruct & @PreDestroy Alternatives

This article explains the purpose and usage of Spring Boot’s @PostConstruct and @PreDestroy annotations for bean initialization and cleanup, discusses their migration to Jakarta EE in Spring Boot 3+, and presents modern alternatives such as @EventListener with ApplicationReadyEvent, DisposableBean, and destroyMethod configurations, complete with code examples.

EventListenerJavaPostConstruct
0 likes · 8 min read
Master Spring Boot 3 Bean Lifecycle: @PostConstruct & @PreDestroy Alternatives
Java Tech Enthusiast
Java Tech Enthusiast
Sep 12, 2025 · Backend Development

Mastering Graceful Shutdown in Spring Boot: Hooks, Events, and @PreDestroy

Learn how to implement graceful shutdown in Spring Boot by understanding the JVM shutdown hook, customizing cleanup logic with ContextClosedEvent listeners and @PreDestroy annotations, and configuring the spring.main.register-shutdown-hook property to ensure resources are released safely during application termination.

ContextClosedEventGraceful ShutdownJava
0 likes · 9 min read
Mastering Graceful Shutdown in Spring Boot: Hooks, Events, and @PreDestroy
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Aug 5, 2025 · Backend Development

Master Spring Boot Lifecycle: Init & Destroy Callbacks Explained

This article explains Spring Boot’s bean lifecycle callbacks, covering InitializingBean and DisposableBean interfaces, @PostConstruct and @PreDestroy annotations, initMethod and destroyMethod configurations, as well as alternative approaches like SmartInitializingSingleton, ContextRefreshedEvent, and AutoCloseable, with code examples and execution order details.

DisposableBeanInitializingBeanLifecycle
0 likes · 7 min read
Master Spring Boot Lifecycle: Init & Destroy Callbacks Explained
Architecture Digest
Architecture Digest
Oct 13, 2023 · Backend Development

Graceful Shutdown of Spring Boot Applications: Avoiding kill -9 and Using Actuator, Custom Configurations, and PreDestroy

This article explains why using kill -9 to terminate Linux processes can cause data loss, demonstrates how to gracefully stop Spring Boot services with kill -15, the Actuator shutdown endpoint, and custom shutdown configurations, and shows how to add pre‑destroy hooks for backup tasks.

ActuatorGraceful ShutdownJava
0 likes · 19 min read
Graceful Shutdown of Spring Boot Applications: Avoiding kill -9 and Using Actuator, Custom Configurations, and PreDestroy
Java Backend Technology
Java Backend Technology
Jul 11, 2023 · Backend Development

Why kill -9 Can Corrupt Your Spring Boot Service and How to Shut It Down Gracefully

This article explains the dangers of using the Linux kill -9 command on Spring Boot applications, illustrates data loss scenarios, and provides multiple graceful shutdown methods—including SIGTERM, Spring's ConfigurableApplicationContext, Actuator endpoints, and custom Tomcat shutdown configurations—complete with code examples and best‑practice tips.

ActuatorGraceful ShutdownJava
0 likes · 21 min read
Why kill -9 Can Corrupt Your Spring Boot Service and How to Shut It Down Gracefully
Selected Java Interview Questions
Selected Java Interview Questions
May 6, 2023 · Backend Development

Graceful Shutdown of Spring Boot Applications: Avoiding kill -9 and Using Actuator, Shutdown Hooks, and Custom Configurations

This article explains why using the violent kill -9 command can corrupt data in Java services, describes the four‑step graceful shutdown process, and provides multiple Spring Boot solutions—including SIGTERM, Actuator shutdown endpoint, custom Tomcat connector, and @PreDestroy data‑backup hooks—to stop services safely while handling thread interruptions.

ActuatorGraceful ShutdownJava
0 likes · 20 min read
Graceful Shutdown of Spring Boot Applications: Avoiding kill -9 and Using Actuator, Shutdown Hooks, and Custom Configurations
Selected Java Interview Questions
Selected Java Interview Questions
Feb 23, 2022 · Backend Development

Graceful Shutdown Techniques for Spring Boot Applications

The article explains why killing a Spring Boot process with SIGKILL is unsafe and presents five practical ways—using Actuator, closing the application context, writing a PID file, invoking SpringApplication.exit, and creating a custom shutdown controller—to achieve a graceful shutdown while ensuring @PreDestroy methods run and resources are released.

ActuatorGraceful ShutdownPreDestroy
0 likes · 7 min read
Graceful Shutdown Techniques for Spring Boot Applications
Programmer DD
Programmer DD
Apr 28, 2021 · Backend Development

How to Gracefully Shut Down a Spring Boot Application: 5 Proven Methods

Learn five practical ways to gracefully shut down a Spring Boot application—including using Actuator’s shutdown endpoint, closing the application context, PID file handling, SpringApplication.exit, and a custom shutdown controller—so unfinished tasks finish, logs flush, and services stop safely without resorting to kill‑9.

ActuatorBackendGraceful Shutdown
0 likes · 9 min read
How to Gracefully Shut Down a Spring Boot Application: 5 Proven Methods
Java Captain
Java Captain
Jan 18, 2020 · Backend Development

Graceful Shutdown Techniques for Spring Boot Applications

This article explains why graceful shutdown is important for Spring Boot services and demonstrates five practical methods—including Actuator shutdown, context closing, PID file handling, SpringApplication.exit, and a custom controller—each with complete code examples and usage instructions.

ActuatorGraceful ShutdownJava
0 likes · 8 min read
Graceful Shutdown Techniques for Spring Boot Applications