I am working on a spring batch project where use case is: Spring batch job relies on the file present at SFTP server( remote directory) So, Once the file gets available in SFTP server, a corresponding job (spring batch) should start. Moreover, I don't want to first start the job and then look for the file because that would be time based approach rather I am looking for notification based approach. So I thought to use spring integration (sftp inbound channel adaptor). As part of Inbound adaptor (SFTP) once I get/receive/download new file (based on timestamp) present at remote directory of SFTP server, I want to notify spring batch application and then trigger a Job. For e.g if there are two files at remote directory say 1.txt, 2.txt. These files come on daily basis. So once my channel receives new file at remote directory, it should
- download1.txt and then notify spring batch application to launch Spring batch Job1
- download2.txt and then notify spring batch application to launch Spring batch Job2
Can anyone validate this approach and guide further.