Spring batch multithreaded ItemWriter
<p>I am quite new to Spring batch framework.</p>

<p>I am currently writing a batch with a reader and a writer.</p>

<p>Reader reads from Db and writer writes to a flat file.  The number of records are 1 million.  Writing to file takes a lot of time and I want to improve on that.</p>

<p>What is the best way I can achieve multithreading in writer so that <code>write()</code> method runs in parallel?  </p>

<p>Note: In <code>@BeforeStep</code> and <code>@AfterStep</code> callbacks, I am writing header and footer of the file.  <code>write()</code> method writes the records to file. </p>

<p><strong>EDIT:</strong></p>

<p>I have found out that, writing to file isn't taking much time but one of our internal method which does some sort of decryption takes about 500ms for 1 record. And we have 1 million such records.</p>

<p>Can I improve the performance by doing decryption in multiple threads?  I am not able to understand how to improve from here on.</p>