I am writing a new application where the clients want to communicate using files over (S)FTP.
The first use case is that the client puts a file on the FTP server at end of day. I then process it and upload it line by line to my REST API.
The second use case is that there will be 2 or 3 drops intra-day for error processing.
At the moment I have a proof of concept that is just a main class that uses Apache Camel to gets a csv in a directory, reads it line by line, converts it, uploads each item to the REST API and shut down.
My reason for this idea was that it could be a batch process run at an agreed upon time at end of day and assume that the file was there or write (email?) an error if it was missing.
This wouldn't really work for the second use case though as I imagine that I should be watching the FTP directory constantly for new files.
Having a single batch process didn't seem to require much in the way of reliability and complexity.
Running it continuously seems like it might be more complicated and error prone and might require something like Spring Boot or a webserver or something.
What would be the model for this?