OPEN - issue BATCH-409: StatefulRetryStepFactoryBean needs to co-ordinate exception handler with retry policy
http://jira.springframework.org/browse/BATCH-409 Use retryLimit and exception types instead of retry policy - in the spirit of a factory bean being easy to configure for typical use cases.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="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"
|
||||
<beans xmlns="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
|
||||
@@ -15,24 +13,16 @@
|
||||
class="org.springframework.batch.execution.step.support.StatefulRetryStepFactoryBean">
|
||||
<property name="itemReader" ref="itemGenerator" />
|
||||
<property name="itemWriter" ref="itemWriter" />
|
||||
<property name="retryPolicy">
|
||||
<bean
|
||||
class="org.springframework.batch.retry.policy.SimpleRetryPolicy">
|
||||
<property name="maxAttempts" value="3" />
|
||||
<property name="retryableExceptionClasses"
|
||||
value="java.lang.Exception" />
|
||||
</bean>
|
||||
</property>
|
||||
<property name="retryLimit" value="3" />
|
||||
<property name="retryableExceptionClasses" value="java.lang.Exception" />
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="itemGenerator"
|
||||
class="org.springframework.batch.sample.item.reader.GeneratingItemReader">
|
||||
<bean id="itemGenerator" class="org.springframework.batch.sample.item.reader.GeneratingItemReader">
|
||||
<property name="limit" value="10" />
|
||||
</bean>
|
||||
|
||||
<bean id="itemWriter"
|
||||
class="org.springframework.batch.sample.item.writer.RetrySampleItemWriter" />
|
||||
<bean id="itemWriter" class="org.springframework.batch.sample.item.writer.RetrySampleItemWriter" />
|
||||
|
||||
</beans>
|
||||
Reference in New Issue
Block a user