title: Partitioning processing of each chunk in spring batch
body: <p>I am using spring batch framework. I am seeking for a solution for below requirement.</p>
  
  <p>Let say there are 5000 records in data base table.I want 5 chunks to be created(That is each chunk is processing 1000 records) &amp; processing of each chunk should be partitioned (1000 records by 5 partitions where each partition process 200 records).</p>
  
  <p></p>
  
  <p>This is different from partitioning config as below.</p>
  
  <p></p>
  
  <pre><code>        &lt;batch:step id="partitionRBMRead" next="job1.flow1"&gt;                
              &lt;batch:partition partitioner="rbmPartitioner" step="readDataFromRBM"&gt;       
                  &lt;batch:handler grid-size="50" task-executor="taskExecutor"/&gt;   
              &lt;/batch:partition&gt;              
          &lt;/batch:step&gt;                   
  
          &lt;batch:flow parent="generateCsvFlow" id="job1.flow1" /&gt;
      &lt;/batch:job&gt;    
  </code></pre>
  
  <p>Because according to this configuration it creates partitions first &amp; processes them in parallel. But what I want is executing 5 chunks (of size 1000) sequentially &amp; processing each chunk with 5 parallel threads.</p>
  
  <p>Chunk 1 (Record 1 to 1000) => partition 1 (Record 1 to 200)|| partition 2 (Record 201 to 400) || partition 3 (Record 401 to 600) || partition 4 (Record 601 to 800) || partition 5 (Record 801 to 1000)</p>
  
  <p>Chunk 2 (Record 1001 to 2000) => partition 1 (Record 1001 to 1200)|| partition 2 (Record 1201 to 1400) || partition 3 (Record 1401 to 1600) || partition 4 (Record 1601 to 1800) || partition 5 (Record 1801 to 2000)</p>
  
  <p>Can any one please help me out of it? Thanks.</p>