Hi All
I configured a skip Listener for a step and it doesn't seem like it is working.
I am introducing an error during write. As I would expect, since transaction is rolled back the chunk is not written to the database. However, i was expecting to see this listener being called so that I could capture what was not written to the database. It doesn't get called. I also tried using a ItemWriteListener which was not called either. what am I doing wrong
Here is my listener class:
Public class BPMSkipListener implements SkipListener {
@Override
public void onSkipInProcess(Object arg0, Throwable arg1) {
// TODO Auto-generated method stub
System.out.println(" process skip");
}
@Override
public void onSkipInRead(Throwable arg0) {
// TODO Auto-generated method stub
System.out.println(" Read skip");
}
@Override
public void onSkipInWrite(Object arg0, Throwable arg1) {
// TODO Auto-generated method stub
System.out.println(" Record Skipped :"+arg0.toString()+" = Error:"+arg1);
}
and here is the step configuration:
<step id="gameLoad" next="playerSummarization" >
<tasklet transaction-manager="bpmTransactionManager" >
<chunk reader="gameFileItemReader" writer="gameWriter"
commit-interval="${job.commit.interval}" skip-limit="10">
<skippable-exception-classes>
<include class="java.lang.Exception"/>
</skippable-exception-classes>
</chunk>
<listeners>
<listener ref="bpmSkipListener"/>
</listeners>
</tasklet>
</step>
<bean id="bpmSkipListener" class="com.xxxxxx.bpm.batch.base.BPMItemWriteListe ner"/>



Reply With Quote