Announcement Announcement Module
No announcement yet.
Processing multiple files in one job Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Processing multiple files in one job


    I have to process N xml files that I only know the directory path and that they can be *.xml named.

    I wanted to do a job with the following steps:
    1. Iterate through the directory and get all the files names
    2. Generate one entity from the data of each xml
    3. Convert each entity generated to a pojo that maps a data source
    4. Puts each pojo on a collection
    5. Send the collection to the data source for creation/updating/delete

    Spring-batch documentation is really simple and useful on all steps, but the question that I have is: how to make the multiple file processing and not single file processing?

  • #2
    In the 1.1 trunk there is MultiResourceItemReader which should do what you need (there's also multiResourceJob sample).