Announcement Announcement Module
No announcement yet.
Running Multiple Instances in Multiple JVMs Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Running Multiple Instances in Multiple JVMs


    I have written the batch process using spring batch...which works fine in single instance.

    I need to create multiple instances of this in multiple JVMs for better performance.How to make sure that instance in different JVM dont process same file on the file system. ?

    How do I go about it?

    Thanks In advance
    Last edited by Padmala; Sep 17th, 2008, 11:33 PM.

  • #2
    The best approach is probably to use the ItemWriter.flush() to send a message to the remote workers with the file names or directory names to process (assuming that remote workers have access to the filesystem). You have to give the message guaranteed delivery and a single consumer, which makes JMS the most obvious off-the-shelf vehicle.

    This is what we are doing in 2.0 in the remote chunking pieces of Spring Batch. The code is still prototypical but you can see it in nightly snapshots or in SVN ( Also see the "Enterprise Integration" section on the website (