【发布时间】:2016-05-24 00:06:08
【问题描述】:
我有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"
}
}
【问题讨论】:
标签: scala apache-camel akka scalaz akka-camel