Announcement Announcement Module
No announcement yet.
Auto Restart of failed job not working Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Auto Restart of failed job not working


    I am trying to retry a job in case an exception is raised during the execution of the job. But for some reason, the job is not restarted automatically. Her is the configuration I am using :

    job id="trialJob" xmlns=""
    <step id="step1">
    <tasklet ref="trialStep" />

    <bean id="trialStep"

    <aopointcut id="transactional"
    expression="execution(**.*execute(..))" />
    <aop:advisor pointcut-ref="transactional" advice-ref="retryAdvice"
    order="-1" />

    <bean id="retryAdvice"
    class="org.springframework.batch.retry.interceptor .RetryOperationsInterceptor">
    <property name="retryOperations">
    <bean class=" ryTemplate">
    <property name="retryPolicy">
    <bean class="org.springframework.batch.retry.policy.Simp leRetryPolicy">
    <property name="maxAttempts" value="4" />

    <property name ="retryableExceptions">
    <entry key="java.lang.Exception" value="true" />

    My understanding is that with the above aop configuration, if there is an exception in the execute() method of any class in package, the job must be restarted automatically from where it stopped but it doesnt happen so.

    Can some one please advice what I am missing here ?

    Thanks in advance

  • #2
    Any suggestions on this please? I need this very urgent.
    The problem is that there is no error shown but the retry logic simple doesnt execute.