Spring 批次 2.2.7 中缺少 SkipLimitStepFactoryBean
SkipLimitStepFactoryBean is missing from Spring Batch 2.2.7
我正在从 Spring 批次 1.1.4 迁移到 Spring 批次 2.2.7,我发现新库中缺少 SkipLimitStepFactoryBean
。
我知道了 link - http://forum.spring.io/forum/spring-projects/batch/58139-skiplimitstepfactorybean-missing-in-spring-batch-2-0-0-m3 which says that it has been renamed to FaultTolerantStepFactoryBean
.
然而,当我看到这个class FaultTolerantStepFactoryBean
, it doesn't have setFatalExceptionClasses(java.lang.Class[])
方法时,我想配置。有人知道怎么做吗?
下面是 Spring Batch 1.1.4 jobs.xml
中的 bean 配置方式
<bean id="loadbaseListSkipLimitStep"
class="org.springframework.batch.core.step.item.SkipLimitStepFactoryBean"
parent="loadbaseListStep"
abstract="true">
<property name="skipLimit" value="0" />
<property name="retryPolicy" ref="recoverableExceptionRetryPolicy" />
<property name="backOffPolicy" ref="timedBackoffPolicy" />
<property name="fatalExceptionClasses" value="org.springframework.jms.JmsException, org.springframework.dao.DataAccessException" />
</bean>
所述
Because everything is fatal, unless you specify it as a skippable
exception.
因此,我的 XML 配置更改如下。
<bean id="loadbaseListSkipLimitStep"
class="org.springframework.batch.core.step.item.SkipLimitStepFactoryBean"
parent="loadbaseListStep"
abstract="true">
<property name="skipLimit" value="0" />
<property name="retryPolicy" ref="recoverableExceptionRetryPolicy" />
<property name="backOffPolicy" ref="timedBackoffPolicy" />
</bean>
我正在从 Spring 批次 1.1.4 迁移到 Spring 批次 2.2.7,我发现新库中缺少 SkipLimitStepFactoryBean
。
我知道了 link - http://forum.spring.io/forum/spring-projects/batch/58139-skiplimitstepfactorybean-missing-in-spring-batch-2-0-0-m3 which says that it has been renamed to FaultTolerantStepFactoryBean
.
然而,当我看到这个class FaultTolerantStepFactoryBean
, it doesn't have setFatalExceptionClasses(java.lang.Class[])
方法时,我想配置。有人知道怎么做吗?
下面是 Spring Batch 1.1.4 jobs.xml
中的 bean 配置方式<bean id="loadbaseListSkipLimitStep"
class="org.springframework.batch.core.step.item.SkipLimitStepFactoryBean"
parent="loadbaseListStep"
abstract="true">
<property name="skipLimit" value="0" />
<property name="retryPolicy" ref="recoverableExceptionRetryPolicy" />
<property name="backOffPolicy" ref="timedBackoffPolicy" />
<property name="fatalExceptionClasses" value="org.springframework.jms.JmsException, org.springframework.dao.DataAccessException" />
</bean>
Because everything is fatal, unless you specify it as a skippable exception.
因此,我的 XML 配置更改如下。
<bean id="loadbaseListSkipLimitStep"
class="org.springframework.batch.core.step.item.SkipLimitStepFactoryBean"
parent="loadbaseListStep"
abstract="true">
<property name="skipLimit" value="0" />
<property name="retryPolicy" ref="recoverableExceptionRetryPolicy" />
<property name="backOffPolicy" ref="timedBackoffPolicy" />
</bean>