This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Integration batch help

Oct 30th, 2012, 12:25 PM

Hi All,

I'm writing a simple application that uses both spring-integration and spring-batch. The app polls a directory, moves the found file into a 'processing' directory and then launches the batch job using the file. On completion of the job, the file is moved into the 'processed' directory.

Comment

Yes, the configuration is still the same from my original post except for the errorChannel config. I've added a try/catch & rethrow and confirmed the exception is being thrown. To be a bit more specific, I've deleted the batch specific tables from my database and the exception thrown by the job launcher is the one I'm trying to catch.

Currently I'm not using the jobExecution, I just want to move the file after the job has been run.

Comment

As you suggested, I have changed the 'processing' channel to a <publish-subscribe-channel/>. As I would like to move the file into the 'processed' directory even if the first subscriber throws an exception, I set 'ignore-failures="true"' . This gives me the desired behaviour but perhaps using the errorChannel might be better.