I have an application (Scala 2.10.3, Akka 2.3.1, Camel 2.13.0) which subscribes to a JMS Topic, and is notified via JMS messages when specific files are available for download. Each JMS message includes the name+path of a file which is available for collection via SFTP.
I then want to be able to fetch the files via SFTP, but only fetch files for which we have received a JMS message (to avoid problems where we might fetch a file which is in-progress of being written).
I want a solution which fits in with Akka Camel and the Consumer model. I've read through the Camel options for file2 and ftp2 which are used for SFTP endpoints, but I need help with:
how can I define a class/object which can be referenced in the endpointUri string via &filter=... parameter? I would want to be able to update the filter object so that every time the Consumer polls for a list of files, the updated filter list is applied.
how can I define a custom IdempotentRepository, to allow cache sizes larger than the default of 1000?
My SFTP Consumer Actor currently looks like this (with some values redacted ...):
class SftpConsumer extends Actor with ActorLogging with Consumer {
val host = ...
val username = ...
val keyFile = ...
def endpointUri: String = s"sftp://${host}?username=${username}&privateKeyFile=${keyFile}&idempotent=true"