Results 1 to 3 of 3

Thread: How to launch a job from file poller

  1. #1
    Join Date
    Mar 2010
    Location
    Stockport
    Posts
    2

    Default 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. #2
    Join Date
    Jun 2005
    Posts
    4,231

    Default

    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

  3. #3
    Join Date
    Mar 2010
    Location
    Stockport
    Posts
    2

    Default Thanks

    Cheers, much appreciated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •