Spring scheduler is stopping unexpectedly and starting again

北战南征 提交于 2019-12-23 07:58:32

问题


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

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