BATCH-1744: fix integratiom tests to use step scoped policy approach

This commit is contained in:
Dave Syer
2011-05-05 09:34:49 +01:00
parent 0b475e16b8
commit e666f4e6cf
2 changed files with 21 additions and 9 deletions

View File

@@ -9,14 +9,7 @@
<step id="playerload" next="gameLoad">
<tasklet>
<chunk reader="playerFileItemReader" writer="playerWriter" commit-interval="${job.commit.interval}"
skip-limit="#{jobParameters['skip.limit']}" retry-limit="#{jobParameters['retry.limit']}">
<skippable-exception-classes>
<include class="org.springframework.dao.DataAccessException" />
</skippable-exception-classes>
<retryable-exception-classes>
<include class="org.springframework.dao.DataAccessException" />
</retryable-exception-classes>
</chunk>
skip-policy="skipPolicy" retry-policy="retryPolicy"/>
</tasklet>
</step>
<step id="gameLoad" next="playerSummarization">
@@ -30,6 +23,24 @@
</step>
<step id="playerSummarization" parent="summarizationStep" />
</job>
<bean id="skipPolicy" class="org.springframework.batch.core.step.skip.LimitCheckingItemSkipPolicy" scope="step">
<property name="skipLimit" value="#{jobParameters['skip.limit']}" />
<property name="skippableExceptionMap">
<map key-type="java.lang.Class">
<entry key="org.springframework.dao.DataAccessException" value="true"/>
</map>
</property>
</bean>
<bean id="retryPolicy" class="org.springframework.batch.retry.policy.SimpleRetryPolicy" scope="step">
<property name="maxAttempts" value="#{jobParameters['retry.limit']}" />
<property name="retryableExceptions">
<map key-type="java.lang.Class">
<entry key="org.springframework.dao.DataAccessException" value="true"/>
</map>
</property>
</bean>
<step id="summarizationStep" xmlns="http://www.springframework.org/schema/batch">
<tasklet>