I wanted to skip some record on process.
what i have tried is, i have created custom exception and throw the exception when i want to skip the record and its calling
@Component
@Scope(value = "step")
public class XyzItemProcessor implements ItemProcessor {
@Override
public ABCInfo process(ABCInfo abcInfo) throws Exception {
if (abcInfo.getRecordType().equals("H") || extVoterInfo.getRecordType().equals("T"))
return null;////this is how we skip particular record to persist in database
else {
return abcInfo;
}
}
}
Return null will skip the particular record to be persisted in database