私はakka camel-ftp
消費者を持っています。すべての例外をコードで処理したいと考えています (認証例外、ftp 上のファイルを読み取れないなど)。スタックトレースはログにしか表示されず、処理できません。を使ったほうがいいかもしれませんscalaz-camel
。
さらに、すべてのファイルがいつ処理され、次に 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"
}
}