title: spring batch - processor chain
body: <p>I need to execute seven distinctive processes sequently(One after the other). The data is stored in Mysql. I am thinking of the following options, Please correct me if I am wrong, or if there is a better solution.</p>
  
  <p>Requirments:</p>
  
  <ol>
  <li><p>Read the data from the Db, do the seven processes(datavalidation, calculation1, calculation2 ...etc.) finally, write the processed data into the DB.</p></li>
  <li><p>Need to process the data in chunks.</p></li>
  </ol>
  
  <p>My solution and issues:
  Data read:</p>
  
  <ol>
  <li>Read the data using JdbcCursorItemReader, because this is the best performing db reader - But, the SQL is very complex , so I may have to consider a custom ItemReader using JdbcTemplate? which gives me more flexibility in handling the data.</li>
  </ol>
  
  <p>Process:</p>
  
  <ol>
  <li><p>Define seven steps and chunks, share the data between the steps using databean. But, this won't be a good idea, because the data processes in chunks and after each chunk the step1 writer will create a new set of data in the databean. When this databean shared across the other steps, data integrity will be an issue.</p></li>
  <li><p>Use StepExecutionContext to share the data between steps. But this may affect the performance as this involves Batch job repository.</p></li>
  <li><p>Define only one step, with one ItemReader, and a chain of processes (the seven processes), and create one ItemWriter which writes the processed data into the DB. But, I won't be able to administrate or monitor each different processes, all will be in one step. </p></li>
  </ol>