Spring Boot Batch - execluding JobLauncherCommandLineRunner

风流意气都作罢 提交于 2020-05-13 06:17:21

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/27752434/spring-boot-batch-execluding-joblaunchercommandlinerunner

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!