问题
I have nearly 70 jobs which are running using spring job scheduler. 5 of them are daily jobs, 20 of them are weekly jobs and remaining will run monthly.
I configured in applicationContext.xml
file as below
<task:scheduler id="myScheduler" pool-size="50" />
Even though I configured 50 threads still I am facing the issues.
Problem: all daily jobs are not running daily.The jobs running details for 8 days are listed below
Job_Number No.Of times Ran
---------- ---------------
1 8
2 6
3 4
4 8
5 7
I am unable to understand why it is happening. I did lot of search still did not found solution.Please suggest me on this..
For testing purpose I commented my entire business logic as well(Means I scheduled just empty methods).Even in this scenario also I got the same problem.
I specified cron expressions as follows
monthly_cron_expression = 0 00 02 15 * ?
weekly_cron_expression = 0 00 03 ? * FRI
daily_cron_expression = 0 5 10 * * ?
回答1:
could you change the chron expresson for the daily job as follows and give a try daily_cron_expression = 0 5 10 * * *
来源:https://stackoverflow.com/questions/40234549/spring-scheduler-is-stopping-unexpectedly-and-starting-again