Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot Batch - execluding JobLauncherCommandLineRunner

i have a simple Spring Batch job configured in Spring Boot (something similar to the spring guides). at startup, it auto-detects and invokes JobLauncherCommandLineRunner and i want to stop that behavior. I want the job to only be fired by a defined trigger elsewhere in the app, not on startup.

i've tried the @ComponentScan(excludeFilters... approach but it still gets invoked.

any way to switch off this 'helper' class?

like image 232
incomplete-co.de Avatar asked Dec 05 '22 04:12

incomplete-co.de


1 Answers

You can set spring.batch.job.enabled=false or you can set spring.batch.job.names=none (see source code for details).

like image 101
Dave Syer Avatar answered Jan 03 '23 22:01

Dave Syer