I have akka camel-ftp
consumer. I would like to handle all exceptions in code (e.g. Authentification Exception, or file on ftp cannot be read). I can see stacktrace in logs only and cannot handle it.
Maybe it is better to use scalaz-camel
.
Additionally I would like to know when all files are processed and Actor idle untill next read ftp folder
class FtpWorkerActor() extends Consumer with ActorLogging {
override def receive: Actor.Receive = {
case msg: CamelMessage => /* handle files */
case v: Any => /*never riched. but i need to understand if I have authentification issues etc*/
}
override def endpointUri: String = {
val initDelay = 1000 // 1 second
val otherOptions = s"disconnect=true&throwExceptionOnConnectFailed=true&filter=#datFileFilter&delay=$processingDelay&initialDelay=$initDelay"
s"ftp://$username@$ftpSourcePath?username=$username&password=$pass&$otherOptions"
}
}