Mule Quartz - Cron for all week days except 1st day of month

微笑、不失礼 提交于 2020-01-06 06:07:07

问题


The cron expression 0 30 4 2-31 * MON-FRI * is invalid because of error:

java.text.ParseException: Support for specifying both a day-of-week AND a day-of-month parameter is not implemented.

But maybe there is another way to specify such cron expression:

Execute every weekday except first day of month on 4:30.

Is it possible using W parameter?

I'm using Quartz Crone expression in MuleSoft quartz:inbound-endpoint configuration.


回答1:


http://www.quartz-scheduler.org/api/2.1.7/org/quartz/CronExpression.html

Support for specifying both a day-of-week and a day-of-month value is not complete (you'll need to use the '?' character in one of these fields).

You could use 0 30 4 ? * MON-FRI *

At 04:30:00am, every day between Monday and Friday, every month

You could do an expression filter check to see if today's date is not the first, and then proceed.

<expression-filter expression="#[server.dateTime.getDayOfMonth() != 1]" doc:name="Expression"/>


来源:https://stackoverflow.com/questions/54688967/mule-quartz-cron-for-all-week-days-except-1st-day-of-month

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