Announcement Announcement Module
Collapse
No announcement yet.
retry after 30 seconds delay Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • retry after 30 seconds delay

    Hi ,
    I am doing one spring batch application which used to get a file from server. which is working fine.
    If server down, i set retry as 3 times.
    now i need to set delay of 30 seconds for each delay .

    can any one guide me or give me any example of xml file for retry with some delay.

    here is my code :
    --------------
    <bean id="simpleStep1" class="org.springframework.batch.sample.domain.tas kletFileDownload.ACHAlertFaultTolerantStepFactoryB ean">
    <property name="itemReader" ref="itemGenerator" />
    <property name="itemWriter" ref="itemWriter" />
    <property name="itemProcessor" ref="ftpParamValues" />
    <property name="retryLimit" value="3" />
    <property name="retryableExceptionClasses" value="java.lang.Exception" />
    <property name="jobRepository" ref="jobRepository"/>
    <property name="backOffPolicy" ref="fixedBackOff"></property>
    <!-- property name="retryPolicy" ref="timeoutRetryPolicy"/ -->
    </bean>

    <bean id="fixedBackOff" class="org.springframework.batch.sample.domain.tas kletFileDownload.FixedBackOffPolicy">


    <property name="backOffPeriod" value="40000"/>
    </bean>

  • #2
    There was an issue related to this in 1.1.3, which has been fixed:

    http://jira.springframework.org/browse/BATCH-901

    Or are you using 2.0?

    Comment


    • #3
      yes i am using spring 2.0

      yes i am using spring 2.0 .
      can you give me any example with the xml file and its related java files for setting delay

      Comment


      • #4
        Delay is set via the backoff policy, which is described in the retry section of the docs.

        Comment


        • #5
          delay with example

          can you give me the delay exmaple with the xml file

          <bean id="simpleStep1" class="org.springframework.batch.sample.domain.tas kletFileDownload.FaultTolerantStepFactoryBean">
          <property name="itemReader" ref="itemGenerator" />
          <property name="itemWriter" ref="itemWriter" />
          <property name="itemProcessor" ref="ftpParamValues" />
          <property name="retryLimit" value="3" />
          <property name="retryableExceptionClasses" value="java.lang.Exception" />
          <property name="jobRepository" ref="jobRepository"/>
          <property name="backOffPolicy" ref="fixedBackOff"></property>
          <!-- property name="retryListeners" ref="retryListeners"/ -->
          <!-- property name="retryPolicy" ref="timeoutRetryPolicy"/ -->
          </bean>



          can you give me the remaining steps for delay

          Comment


          • #6
            You're likely affected by http://jira.springframework.org/browse/BATCH-994, can you try using the latest trunk?

            Comment

            Working...
            X