Files
spring-batch/spring-batch-samples/src/main/resources/jobs/retrySample.xml

35 lines
1.5 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/batch"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
<job id="retrySample">
<step id="step1">
<tasklet>
<chunk-tasklet reader="itemGenerator"
writer="itemWriter"
commit-interval="1"
retry-limit="3">
<retryable-exception-classes>
java.lang.Exception
</retryable-exception-classes>
</chunk-tasklet>
</tasklet>
</step>
</job>
<beans:bean id="itemGenerator" class="org.springframework.batch.sample.domain.trade.internal.GeneratingTradeItemReader">
<beans:property name="limit" value="10" />
</beans:bean>
<beans:bean id="itemWriter" class="org.springframework.batch.sample.support.RetrySampleItemWriter" />
</beans:beans>