【问题标题】:Custom trigger with spring batch带有弹簧批处理的自定义触发器
【发布时间】:2015-02-08 23:46:09
【问题描述】:

我正在尝试使用我在 SO 回答 here 中找到的每月最后一天自定义触发器

如何在 xml 中引用 LastDayOfMonthTrigger?我想用这个自定义触发器替换玉米表达式。
以下是我配置工作上下文的方式。

<batch:job id="someJob">
    <batch:step id="someStep">
        <batch:tasklet ref="someTask"/>
    </batch:step>
</batch:job>
<bean id="someScheduler" class="com.my.org.scheduler.RunScheduler">
    <constructor-arg ref="someJob"/>
    <constructor-arg ref="jobLauncher"/>
</bean>

<task:scheduled-tasks>
   <task:scheduled ref="someScheduler" method="run" cron="0 0/5 * * * ?"/>
</task:scheduled-tasks>

【问题讨论】:

    标签: spring spring-batch cronexpression


    【解决方案1】:
    0 0 0 L * ?
    

    这个 cron 表达式将在每个月的最后一天凌晨 12:00 You can verify it here 触发您的调度程序

    【讨论】:

    • 感谢您的回复,但这只有在我有石英调度程序时才有效。 L 没有在我正在使用的 spring 调度程序中实现。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-21
    • 2019-12-06
    • 1970-01-01
    相关资源
    最近更新 更多