春のバッチを実行している間、私は奇妙な状況に直面しています。「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());
}
ログ ファイルがスキップされた項目を 2 回出力したのはなぜでしょうか。修正する友達を教えてください...