Announcement Announcement Module
No announcement yet.
Don't know what Reader to use for multiple files Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Don't know what Reader to use for multiple files

    I'm a newbie using spring batch.
    I get stucked and don't know what to use for my problem.

    The process will be triggered every 10 min. The process read a directory where an process will drop edifact files. Each of the file need to be parsed and processed. The parsing bit is done, I don't know how to pick up the files from the directory.
    The MultiResourceItemReader seems not to be the right solution. Because I want for every file it's own job (thread).
    I did a lot of reading on the news groups but I couldn't find a clear anwser.

    Please advise

    Regards Dirk

  • #2
    Reading multiple files

    Welcome to the wonderful world of Batch!

    I don't know what you type of data you are reading, but it sounds like what you're asking is how do you get multiple files into the same batch process. Scan directory, if file exists, send to batch, batch reads file, parses file, does something with it, and moves to next file? Is this correct?

    If so than it's separate area of responsibility. Some people use Quartz or Scheduling to poll a directory and run the batch job on files contained within. Personally I use Spring Integration to handle the polling, and sending/initializing jobs/handling resulting messages from jobs. If you're asking how to poll a system (in this case file system) and inject the the file into your batch this should help:

    Good luck,