We have a job that is pooling. It has to look into a directory and pick up files from there if there are some. A classic "hot folder".
At the moment we have a job with just one step. The reader returns null if there are no (more) files in the directory. The job is started with a delay of 30 seconds.
For us that seams to be the natural way to do it. The problem: It fills the batch database tables with new jobs very fast. You really have to search the other jobs. We filter this, but it is not very nice.Code:<task:scheduled ref="pdfImportStarter" method="startJob" fixed-delay="30000" />
What is the best practice for that use case? Implementing a blocking reader that may be never returns null? Or defining a precondition that we check in the pdfImportStarter? This seams to duplicate code.