When you do not find a file, you must go to the next step (Spring Batch)

0

I'm using Spring Batch.

In my Job, I have several step's, and they all read from a .csv file.

The problem is that there will be times when the .csv file will not be in the read-only location. When that happens, an error pops up and Job stops, but I wish he would just go to the next step.

How can I do this?

    
asked by anonymous 22.02.2017 / 14:50

1 answer

0

Solution:

In class FlatFileItemReader , just call method setStrict(false) ;

By default this value is true. When the value is true and the file is not found, it loops an error and ends the Step with BatchStatus.FAILED .

If the value is false, when an error occurs, it simply terminates the Step as BatchStatus.COMPLETED .

    
22.02.2017 / 18:55