title: Springboot batch read / validate multiple csv files of different format
body: <p>I'm evaluating spring batch for a particular project and after a lot of searching around the web, I haven't been able to find a spring batch solution that meets my requirements. </p>
  
  <p>I'm wondering if spring batch is capable of reading multiple CSV files made up of different formats in a single job? For example, lets say Person.csv and Address.csv, both made up of different formats, but depend on each other </p>
  
  <p>I need to read, process with data corrections (ie toUpperCase, etc), and validate each record. </p>
  
  <p>In the event of validation errors, I need to record the error(s) to some sort of object array where it will be made available later on after validation has completed to be emailed to the end user for corrections. </p>
  
  <p>Once all the data from both files has been validated and no validation errors have occurred in either file, continue on to the batch writer. If any errors have occurred in either of the two files, I need to stop the entire job. If the writer has already began writing to the database when an error has occurred, the entire job would need to be rolled back regardless if the error exist in the opposite file. </p>
  
  <p>I cannot insert any of the two CSV files if there is any kind of validation error in either one. The end user must be notified with the errors. The errors will be used to make any necessary corrections prior to  reprocessing the files. </p>
  
  <p>Is Spring batch in SpringBoot 2 capable of this behavior?</p>
  
  <p><strong>Example</strong></p>
  
  <p>Person.csv</p>
  
  <pre><code>BatchId, personId, firstName, lastName
  </code></pre>
  
  <p>Address.csv</p>
  
  <pre><code>BatchId, personId, address1
  </code></pre>
  
  <p>In the above example the relationship between the two files is the batchId and personId. If there is any kind of validation error in either of the two files, I must fail the entire batch. I'd like to complete validation on both files so I can respond with all the errors, but just not write to the database. </p>