InfiniteSkipPolicy.java
package com.sintia.ffl.admin.optique.catalogue.batch.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.core.step.skip.SkipLimitExceededException;
import org.springframework.batch.core.step.skip.SkipPolicy;
import org.springframework.stereotype.Component;
/**
* This skip policy is used to indicate that skipped exception will be skipped every times, regardless of the number of occurrences
*
* @author jumazet
*/
@Component
public class InfiniteSkipPolicy implements SkipPolicy {
private static final Logger LOGGER = LoggerFactory.getLogger(InfiniteSkipPolicy.class);
@Override
public boolean shouldSkip(Throwable t, int skipCount)
throws SkipLimitExceededException {
LOGGER.debug("One item has been skipped because of the error [{}] for the {} time", t.getLocalizedMessage(), skipCount);
return true;
}
}