在执行春季批次时,我面临着一个奇怪的情况。我已将我的作业步骤执行配置为使用“skippable-exception-classes”作为
<step id="prepareFileStep" next="fillRecordsCounterStep">
<tasklet>
<chunk reader="stagingIdReader" writer="customerIdRecordCompWriter" commit-interval="50" skip-limit="200">
<streams>
<stream ref="flatFileRecordWriter" />
</streams>
<skippable-exception-classes>
<include class="java.lang.Exception" />
</skippable-exception-classes>
</chunk>
<listeners>
<listener ref="prepareFlatFileSkipListener" />
<listener ref="prepareFlatFileStepListener" />
</listeners>
</tasklet>
我的 onSkipInWrite() 实现为:
@OnSkipInWrite
public void onSkipInWrite(Object item, Throwable exception) {
AppLog.warn(AppConstants.CALLER, "Skipping Customer Id:"+ item.getCustomer().getCustomerId()+"\n" + exception.toString());
}
我想知道为什么日志文件两次打印跳过的项目,当我调试时它只执行一次?请给我修复的朋友建议我...