Tagged articles
ApplicationRunner
11 articles · Page 1 of 1
Explore Spring’s extensibility by mastering global exception handling with @RestControllerAdvice, creating custom MVC interceptors, accessing the container via BeanFactoryAware, importing configurations, adding startup logic, modifying BeanDefinitions, using initialization callbacks, and defining a thread‑local custom scope for per‑thread bean instances.
ApplicationRunnerBean LifecycleCustom Scope
0 likes · 10 min read

This article explains the purpose of Spring Boot's ApplicationRunner and CommandLineRunner interfaces, demonstrates common startup tasks such as data initialization, configuration loading, cache population and license verification, compares their parameter handling, shows how to control execution order with @Order, and reveals the internal call chain that Spring uses to invoke these runners.
ApplicationRunnerCommandLineRunnerInitialization
0 likes · 15 min read

This guide explains how to run custom code after SpringApplication starts by implementing ApplicationRunner or CommandLineRunner, compares their method signatures and argument handling, shows execution timing, provides practical examples, and demonstrates how to control execution order with @Order or Ordered.
ApplicationRunnerCommandLineRunnerRunner
0 likes · 7 min read

This article explains the core principles of Spring Boot startup configuration, demonstrates how to intervene using ApplicationContextInitializer, SpringApplicationRunListener, ApplicationRunner, and CommandLineRunner, and provides practical optimization techniques to significantly reduce application launch time.
ApplicationRunnerBackendCommandLineRunner
0 likes · 32 min read

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.
ApplicationRunnerCachePre-warming
0 likes · 4 min read

This article explains the various ways to execute code during a Spring Boot application's startup, comparing Java static blocks, constructors, @PostConstruct methods, and Spring's ApplicationRunner and CommandLineRunner interfaces, including ordering with @Order and providing sample code and execution results.
ApplicationRunnerCommandLineRunnerJava
0 likes · 5 min read

This article explains six practical techniques for executing custom logic during Spring Boot startup, covering ApplicationListener events, CommandLineRunner, ApplicationRunner, @PostConstruct, @Bean initMethod, and InitializingBean, with code examples and brief analysis of each approach.
ApplicationRunnerCommandLineRunnerPostConstruct
0 likes · 10 min read

After launching a Spring Boot 2.3.9 application, you can execute custom tasks using ApplicationRunner or CommandLineRunner, access startup arguments, generate random configuration values, disable command-line properties, understand configuration file loading order, and correctly use @EnableConfigurationProperties for bean binding.
ApplicationRunnerConfigurationPropertiesSpring Boot
0 likes · 6 min read

This article explains the differences between Spring Boot’s CommandLineRunner and ApplicationRunner, illustrates common pitfalls when using CommandLineRunner—such as blocking startup and causing exceptions—and shows how to run tasks in a separate thread to avoid startup failures.
ApplicationRunnerCommandLineRunnerMultithreading
0 likes · 9 min read

This article explains several Spring Boot techniques for initializing resources at application startup, including CommandLineRunner, ApplicationRunner, @Order, @PostConstruct, InitializingBean, and ApplicationListener, and provides code examples and usage guidelines for each method.
ApplicationRunnerCommandLineRunnerInitializingBean
0 likes · 8 min read

This article explains the five ways Spring Boot can execute code during application startup—including CommandLineRunner, ApplicationRunner, ApplicationListener, @PostConstruct, and InitializingBean—detailing their usage, ordering, argument parsing, and best‑practice recommendations.
ApplicationRunnerCommandLineRunnerJava
0 likes · 12 min read
