Announcement Announcement Module
No announcement yet.
Example for parallel processing Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Example for parallel processing

    I need to run a job concurrently within a single JVM (Later in multiple jvm's). I would appreciate if anyone tell me how to achieve that. Also please provide an example if you can.


  • #2
    TaskExecutorRepeatTemplate is the key. Plus you have to be aware that there is no support for Restartable in this case, however you can still have partial failures and restarts as long as you control the data and mark each input record as processed transactionally - then when a job restarts it only selects input data that were not already processed. We have client projects using this approach so it definitely works.

    There isn't a sample job yet (really you should check that parallel processing is necessary before jumping into it, so we have tried not to encourage people to get too excited about it). But the unit tests AsynchronousRepeatTests give you some clues as to what to expect at a low level. You will need to add the TaskExecutorRepeatTemplate to your job (e.g. through the StepConfiguration) as the stepOperations property.


    • #3
      I added a parallelJob.xml to the samples so you can see how to do this in concrete terms. It's a slightly artificial example since parallel processing really wasn't necessary here, but you can see the patterns. We will be providing more native support, probably after 1.0.