The following is the use case for my batch. Read from the database, process the item by calling a web service, update the item in the database using item writer. I am returning the exception in the processor when the processing fails. The problem is it retries the chunk from element 0 again and that is causing my successfully processed items being reprocessed. In this case, it is a web service and hence cannot be rollback. Here is the snippet of the configuration in my job.
<batch:step id="loadData" parent="simpleStep">
<batch:tasklet transaction-manager="transactionManager">
<batch:chunk reader="sourceReader" processor="cbrItemProcessor"
writer="targetWriter" skip-limit="1000000">
<batch:streams>
<batch:stream ref="badItemWriter" />
</batch:streams>
<batch:skippable-exception-classes>
java.lang.Exception
</batch:skippable-exception-classes>
</batch:chunk>
<batch:listeners>
<batch:listener ref="baseSkipListener" />
<batch:listener ref="dataCopyMailListener" />
</batch:listeners>
</batch:tasklet>
<batch:next on="COMPLETED" to="filePurge" />
<batch:end on="FAILED" />
</batch:step>
I did set the retry-limit=0 and still the retry couldnt be avoided. Could someone please help me on this?


Reply With Quote
