Results 1 to 4 of 4

Thread: daemon loop scanning directory for files

  1. #1
    Join Date
    May 2010
    Posts
    18

    Default daemon loop scanning directory for files

    Hello, does spring batch have built-in support for implementing a daemon loop that would scan a specific input directory for files and then process each as a separate job?
    In other words:
    All examples I've seen so far the application is launched against a specific input file, the job gets executed and then the application exits. I'd like to add a loop on top of it so that the application monitors the directory for input files and treats each input file as a separate job. The application does not exit until I send it a specific message/signal. Does spring batch have any support for this or would I need to implement it manually?
    Thanks, Thomas

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,624

    Default

    Spring Batch hasn't... Spring batch is only for batch processing not a mechanism to react on certain triggers to start a job. You can use Spring Integration for that (use a file channel when a file is found launch a batch job).
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    May 2010
    Posts
    18

    Default

    Thanks Marten. That spring integration framework sounds promising.

  4. #4
    Join Date
    Aug 2009
    Location
    Colorado
    Posts
    26

    Default

    If you are processing large files or lots of file, and a batch job makes sense, you may consider using spring-intgration or spring task scheduling to fire off a batch job. Think of spring integration as handling messages, while spring batch is for handling many or large file processing.

Tags for this Thread

Posting Permissions

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