简体   繁体   English

Quartz Cron 表达式无法正常工作

[英]Quartz Cron Expression not working correctly

I'm building an integration using Apache Camel.我正在使用 Apache Camel 构建集成。 I have two routes that are triggered by the following cron expressions:我有两个由以下 cron 表达式触发的路由:

quartz2:delayone?cron=0 */15 23,0 * * ?

quartz2:delaytwo?cron=0 */15 3,4 * * ?

I expect the first to be triggered each day at 11pm every 15 minutes until 12.45 am, which it does!我希望第一个在每天晚上 11 点每 15 分钟触发一次,直到凌晨 12.45,它确实如此!

I expect the second one to be triggered each day at 3am every 15 minutes until 3.45am, which ... it doesn't, it only fires twice once at 3am and then again at 3.15am!我希望第二个在每天凌晨 3 点每 15 分钟触发一次,直到凌晨 3.45,...它没有,它只会在凌晨 3 点触发两次,然后在凌晨 3.15 触发一次!

Can you spot anything I am doing wrong?你能发现我做错了什么吗?

I recommend you to use an online cron expression generator, like this one .我建议你使用在线cron表达式生成器,像这样的一个

在此处输入图片说明

Please note also that the 0 is the first hour, not the last one.另请注意,0 是第一个小时,而不是最后一个小时。 So in "23,0", 0 is not the hour following 11pm, it's 0 am - see screenshot所以在“23,0”中,0 不是晚上 11 点之后的小时,而是上午 0 点 - 看截图

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM