Announcement Announcement Module
Collapse
No announcement yet.
How to launch a job from file poller Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to launch a job from file poller

    I'm a Spring newbie and I want to do the following:-

    1. Poll a directory for files
    2. For each file read, launch a batch job to read and validate the contents of each file.

    I already have the code to do the validation, it currently uses an old Spring
    SimpleFlatFileInputSource but needs to be changed to use a FlatFileItemReader.

    The following link setups a poller

    http://static.springsource.org/sprin...nce.html#files

    The following link tells me I need to setup a FileToJobLaunchRequestAdapter to launch the batch job.

    http://blog.springsource.com/2010/02...g-integration/

    The question is then how to I setup/configure a FileToJobLaunchRequestAdapter?

    The following are the inbound channel adapter config in the first example so how does this need to be changed to call the FileToJobLaunchRequestAdapter?

    <file:inbound-channel-adapter id="filesIn"
    directory="file:${input.directory}"/>

    <file:inbound-channel-adapter id="filesIn"
    directory="file:${input.directory}"
    filter="customFilterBean" />

    <file:inbound-channel-adapter id="filesIn"
    directory="file:${input.directory}"
    filename-pattern="^test.*$" />

    I'm willing to read any articles or recommended books!.

  • #2
    The sample app from Spring Batch Admin has a file polling job. You can see the config here: https://fisheye.springsource.org/bro...ext.xml?r=HEAD

    Comment


    • #3
      Thanks

      Cheers, much appreciated.

      Comment

      Working...
      X