Spring boot application for background workers
问题 I have defined the following Spring boot application: @SpringBootApplication public class Application implements CommandLineRunner { public static void main(String[] args) { new SpringApplicationBuilder(Application.class).web(WebApplicationType.NONE).run(args); } public void run(String... args) throws Exception { Thread.currentThread().join(); } } I also have a package of workers (i.e. could be classes which implements Runnable ). They are supposed to run indefinitely. What is the "Spring way