Announcement Announcement Module
No announcement yet.
Spring Batch triggers the job out of scheduling time Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Batch triggers the job out of scheduling time


    I have spring batch job (which processes the file) that is scheduled to run at 6,7 and 8 AM everyday. Sometimes the job that starts at 6 AM may not complete by 7 AM. In this case, the logic aborts the job starts at 7 AM. But as soon the first job (started at 6 AM) completes, spring batch is triggering another process which is not scheduled.

    For example, Job-A starts at 6 AM. Job-B starts at 7 AM.
    At 7 AM, Job-A still running, So Job-B starts and aborts.
    At 7:15 AM, Job-A completes, immediately another job gets triggered.

    Ideally speaking this should not happen. This is causing unnecessary issue.
    Can you anyone help me on this?

    The following is the spring configuration:

    <bean id="myJob" class="com.test.MyTestJob"/>

    <bean id="myJobDetail" class="org.springframework.scheduling.quartz.Metho dInvokingJobDetailFactoryBean">
    <property name="targetObject" ref="myJob" />
    <property name="targetMethod" value="run" />
    <property name="concurrent" value="false" />

    <bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronT riggerBean">
    <property name="jobDetail" ref="myJobDetail" />
    <property name="cronExpression" value="0 0 6-8 * * ?" />