title: How to set up multi-threading in Spring Batch?
body: <p>I've successfully set up a tutorial Spring Batch project.  I'd really like to know if it's possible to make it multi-threaded at the "Spring level".  </p>
  
  <p>The basic idea of what I want is to make a list of tasks or task steps and let them be picked up and worked on by independent threads, ideally out of a pool limited to 'n' number of threads.</p>
  
  <p>Is this possible?  If so, how?  Could someone show guide me to that point from where I'm currently at?</p>
  
  <p>The simple project I have is from this tutorial <a href="http://java.dzone.com/news/spring-batch-hello-world-1" rel="noreferrer">here</a>.  It basically has different tasks which print out a message to the screen.  </p>
  
  <p>Here's my current simpleJob.xml file, which contains the job details:</p>
  
  <pre><code>&lt;import resource="applicationContext.xml"/&gt;
  
      &lt;bean id="hello" class="helloworld.PrintTasklet"&gt;
          &lt;property name="message" value="Hello"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="space" class="helloworld.PrintTasklet"&gt;
          &lt;property name="message" value=" "/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="world" class="helloworld.PrintTasklet"&gt;
          &lt;property name="message" value="World!\n"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="taskletStep" class="org.springframework.batch.core.step.tasklet.TaskletStep" &gt;
          &lt;property name="jobRepository" ref="jobRepository"/&gt;
          &lt;property name="transactionManager" ref="transactionManager"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="simpleJob" class="org.springframework.batch.core.job.SimpleJob"&gt;
          &lt;property name="name" value="simpleJob" /&gt;
          &lt;property name="steps"&gt;
              &lt;list&gt;
                  &lt;bean parent="taskletStep"&gt;
                      &lt;property name="tasklet" ref="hello"/&gt;
                  &lt;/bean&gt;
                  &lt;bean parent="taskletStep"&gt;
                      &lt;property name="tasklet" ref="space"/&gt;
                  &lt;/bean&gt;
                  &lt;bean parent="taskletStep"&gt;
                      &lt;property name="tasklet" ref="world"/&gt;
                  &lt;/bean&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;property name="jobRepository" ref="jobRepository"/&gt;
      &lt;/bean&gt;
  </code></pre>
  
  <p>My appContext contains the job repository bean (<code>SimpleJobRepository</code>), transaction manager (<code>ResourceLessTransactionManager</code>) and job launcher (<code>SimpleJobLauncher</code>).  I can provide this code if desired as well, I just didn't want to bog down this post with tons of XML.</p>
  
  <p>Thanks very very much for any help!</p>