2017-05-16 3 views
2

ファイル:春の統合のJava DSL:次のファイルの受信を考えるとインバウンドの例外の伝播

IntegrationFlows.from(s -> s 
         .file(directory, new LastModifiedFileComparator()) 
         .patternFilter(inputFileNamePattern) 
         .preventDuplicates(), 
         e -> e.poller(p -> p.trigger(filePollerTrigger)) 
) 

を、ケース一定時間内に例外をスロートリガは1がスローされた例外を受けないか、overreachedましたか?

それはフロー例外チャンネルまたはインバウンド特定のエラーハンドラに表示されますでしょうか?

java dslで対処する正しい方法は何ですか?

ありがとうございます。それが良く聞こえる場合

答えて

0

trigger.nextExecutionTime()からスローされた例外は、ポーリングタスクが停止する原因となる、または再スケジュールではない:

public ScheduledFuture<?> schedule() { 
    synchronized (this.triggerContextMonitor) { 
     this.scheduledExecutionTime = this.trigger.nextExecutionTime(this.triggerContext); 
     if (this.scheduledExecutionTime == null) { 
      return null; 
     } 
     long initialDelay = this.scheduledExecutionTime.getTime() - System.currentTimeMillis(); 
     this.currentFuture = this.executor.schedule(this, initialDelay, TimeUnit.MILLISECONDS); 
     return this; 
    } 
} 

あなたがコードで参照として、それがトリガーからnullと完全に同等です。私たちは再スケジューリングループを終了します。

例外処理ロジックをカスタムTriggerのラッパーとして実装することを検討してください。たとえば、ErrorHandlingTriggerとなります。

関連する問題