我有akka camel-ftp
消费者。我想处理代码中的所有异常(例如身份验证异常,或无法读取 ftp 上的文件)。我只能在日志中看到堆栈跟踪,无法处理。也许最好使用scalaz-camel
.
此外,我想知道所有文件何时被处理并且 Actor 空闲直到下一次读取 ftp 文件夹
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"
}
}