I am looking for a way to disable spring batch's skip-limit, I tried specifying a value of "0" for skip-limit, but is not accepting. Here is my use case:
My batch.xml has skip-limit="${limit_val}"
I want to set ${limit_val} to 0, meaning fail on any exception by default. On seeing the failure, I can look at the reason and decide if its ok to skip the record. If skippable, I want to be able to override ${limit_val} with a value of, say 1 and re-run the batch.
Any help on how this can be achieved?
Have you tried using skip-policy property? In chunk under step define skip-policy="mySkipPolicy" and then give definition of skipPolicy bean.
Provide skipPolicy bean implementation by implementing SkipPolicy Interface.
public class MySkipPolicy implements SkipPolicy
{
private int limit;
public boolean shouldSkip(final Throwable t, final int skipCount) throws SkipLimitExceededException
{
return true or false based on skipCount;
}
}