我想跳过一些处理记录。弹簧批处理 - 在处理中跳过记录
我试过的是,我创建了自定义异常并抛出异常,当我想跳过记录,并调用跳过监听器onSkipInProcess method.Its工作正常。
请找到配置。
<batch:chunk reader="masterFileItemReader" writer="masterFileWriter" processor="itemProcessor" commit-interval="5000" skip-limit="100000" >
<batch:skippable-exception-classes>
<batch:include class="org.springframework.batch.item.file.FlatFileParseException"/>
<batch:include class="com.exception.SkipException"/>
</batch:skippable-exception-classes>
<batch:listeners>
<batch:listener ref="recordSkipListener"/>
</batch:listeners>
但我想知道是否有任何其他的方式来跳过过程的记录?
问候, 桑卡
是的,我们可以跳过coditional基础上进行记录。请查看此代码片段 – 2015-03-13 13:57:35
您可以随时阅读文档[此处](http://docs.spring.io/spring-batch/trunk/reference/html/configureStep.html)和[here](http:/ /docs.spring.io/spring-batch/trunk/reference/html/readersAndWriters.html)。你也可以在这里找到很好的例子(http://www.programcreek.com/java-api-examples/index.php?api=org.springframework.batch.item.ItemProcessor)。 – falsarella 2015-06-15 17:32:10