I have below question regarding failure Issue in Tasklet, I have spring batch project having 3 Tasklet as below,
Tasklet 1.
public class ReadMQMessageTasklet implements Tasklet {
// It will receive all messages from MQ and will save It to Table1
}
Tasklet 2.
public class ParseMQMessageTasklet implements Tasklet {
// It will read all records from Table1
// Loop over all records and It will parse every xml message present in record and It will save It to Table2
}
Tasklet 3.
public class ProcessMQMessageTasklet implements Tasklet {
// It will read all records from Table2
// Loop over all records and It will process each record and save It to table3
// Here for every record we will get 1 xml file and from It we will get many fields and do a complex business logic over It.After that we will save data into 7 different tables
}
Now I have scenario in Tasklet3, Scenario - For example If I have 10 records to process and after processing 6 records If any database exception happen(like null can not be inserted in any of the column) then It should skip 7th record and should proceed with remianing 3 records.
Issue happening - Now the Issue is If we have any exception while processing 7th record It Is not skipping It and terminating the tasklet.
Currently on any exception Its terminating the tasklet step and nothing is committed for the Initial 6 records. how to achieve skipping failed records scenario in Tasklet
Note - I am not using Reader/Writer steps instead using Tasklet