0
私はakka camel-ftp
です。私はコード内のすべての例外を処理したいと思います(例えば、認証例外、またはftp上のファイルを読むことはできません)。 stacktraceがログにのみ表示され、処理できません。 scalaz-camel
を使用する方が良いかもしれません。Akka Scala 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://[email protected]$ftpSourcePath?username=$username&password=$pass&$otherOptions"
}
}
など、こんにちはを停止し、再起動http://doc.akka.io/docs/akka/current/scala/fault-tolerance.html
この場合、あなたの上司は、すべての例外をキャッチし、
FtpWorkerActor
をどうするかを決めることができるようになります。ここではその詳細についてのドキュメントです。答えてくれてありがとう。 IヴァルsupervisorStrategy = OneForOneStrategy(maxNrOfRetries = 2、withinTimeRange = 1分)をオーバーライド '追加{:GenericFileOperationFailedException => log.warning(v.getMessage) 再始動場合_: 場合vは例外が再起動 を⇒} 'にマネージャーの俳優。それは動作しません。私は、GenericFileOperationFailedExceptionログに、camel ftpによって警告(エラーではない)とマークされているのを見ることができます。あなたはいくつかの詳細を共有できますか? –