title: Merge Multiple csv files into Single csv using Spring batch
body: <p>I have a business case of Merge Multiple csv files(around 1000+ Each containing 1000 records )into Single csv using Spring batch .</p>
  
  <p>Please help me provide your guidance and solutions in terms of approach and performance-wise as well.</p>
  
  <p>So far, I have tried two approaches, </p>
  
  <p><strong>Approach 1.</strong> </p>
  
  <p>Tasklet chunk with multiResourceItemReader to read the files from directory and 
  FlatFileItemWriter as item writer.</p>
  
  <p>Issue here is, it is <strong>very slow in processing</strong> since this is single threaded, but approach works as expected.</p>
  
  <p><strong>Approach 2:</strong> 
      Using MultiResourcePartitioner partitioner and AsynTaskExceutor as task-executor.</p>
  
  <p>Issue here is, since it is async multi-thread, <strong>data is getting overwritten/ corrupted</strong> while merging into final single file.</p>