【问题标题】:Spring Boot Batch - execluding JobLauncherCommandLineRunnerSpring Boot Batch - 排除 JobLauncherCommandLineRunner
【发布时间】:2015-03-01 09:23:41
【问题描述】:

我在 Spring Boot 中配置了一个简单的 Spring Batch 作业(类似于the spring guides)。在启动时,它会自动检测并调用 JobLauncherCommandLineRunner,我想停止这种行为。我希望该作业仅由应用中其他位置的已定义触发器触发,而不是在启动时触发。

我已经尝试过 @ComponentScan(excludeFilters... 方法,但它仍然会被调用。

有什么方法可以关闭这个“助手”类?

【问题讨论】:

    标签: spring spring-boot spring-batch


    【解决方案1】:

    您可以设置spring.batch.job.enabled=false,也可以设置spring.batch.job.names=none(详见source code)。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-07-10
    • 2017-09-27
    • 2018-06-13
    • 2016-10-10
    • 2015-07-07
    • 2020-12-30
    • 2017-01-14
    相关资源
    最近更新 更多