Easy java spring

20. What is the real use of CommandLineRunner?

Sample answer: "It runs code once after the context starts and before the app is marked ready, for example warming a cache or checking a dependency. It gets the raw args; ApplicationRunner gets parsed ApplicationArguments. Readiness is not ACCEPTING_TRAFFIC until runners finish, so a slow runner delays traffic in Kubernetes."

Sources (1)
  1. SpringApplication: Application events; Application availability