I am new to spring batch, I have an issue where my write skip count is considered as entire count of chunk and not just the invalid records in the chunk.
For e.g., I am reading 500 records, with chunk size of 100 records per chunk.
Then if the first chunk has 2 invalid records then, all records after that invalid records are mentioned as invalid with 'invalid Exception', where as they not invalid.
So the write_skip_count in batch_step_execution goes as 100, for that batch, rather than 2.
But on other hand, the chunk with invalid records get re-processed and except the two invalid, all records properly reach the destination. Functionality is achieved but the write_skip_count is wrong which prevent us from showing proper log. Please suggest what I am missing here.
and I can see below logs,
Checking for rethrow: count=1
Rethrow in retry for policy: count=1
Initiating transaction rollback on application exception
Below is the code snippet we tried so far,
<batch:step id="SomeStep">
<batch:tasklet>
<batch:chunk reader="SomeStepReader"
writer="SomeWriter" commit-interval="1000"
skip-limit="1000" retry-limit="1">
<batch:skippable-exception-classes>
<batch:include class="org.springframework.dao.someException" />
</batch:skippable-exception-classes>
<batch:retryable-exception-classes>
<batch:exclude class="org.springframework.dao.someException"/>
</batch:retryable-exception-classes>
</batch:chunk>
</batch:tasklet>
</batch:step>