Results 1 to 6 of 6

Thread: retry after 30 seconds delay

  1. #1
    Join Date
    Jan 2009
    Posts
    4

    Thumbs up 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. #2
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    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?

  3. #3
    Join Date
    Jan 2009
    Posts
    4

    Default 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

  4. #4
    Join Date
    Dec 2006
    Posts
    1,061

    Default

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

  5. #5
    Join Date
    Jan 2009
    Posts
    4

    Default 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

  6. #6

    Default

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •