I am using spring batch module to read a complex file with multi-line records. First 3 lines in the file will always contain a header with few common fields. These common fields will be used in the processing of subsequent records in the file. The job is restartable. Suppose the input file has 10 records (please note number of records may not be same as number of lines since records can span over multiple lines). Suppose job runs first time, starts reading the file from line 1, and processes first 5 records and fails while processing 6th record. During this first run, since job has also parsed header part (first 3 lines in the file), application can successfully process first 5 records. Now when failed job restarted it will start from 6th record and hence will not read the header part this time. Since application requires certain values contained in the header record, the job fails. I would like to know possible suggestions so that restarted job always reads the header part and then starts from where it left off (6th record in the above scenario).
Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire