Spring Framework — How can I run a command after start?

If you read some of Spring tutorial, you will find out a class name

CommandLineRunner

Spring will call CommandLineRunner.run(String… var) every time after start

This is an example

CommandLineRunner is called after Spring start
Like what you read? Give Chertpong Horprasertwong a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.