キャメル。ファイル コンポーネント。エラーが発生しなかった場合にのみファイルをコピーするようにルートを構成する必要があります。私が持っているもの:
<route id="importFile" autoStartup="{{fdr.import.enabled}}">
<from uri="direct:startImportFile"/>
<from uri="file://{{fdr.folder.working}}?delete=true&readLock=changed"/>
<transacted ref="fdrTxRequired"/>
<doTry>
<to uri="file://{{fdr.folder.done}}"/> <!--1-->
<bean ref="transactionsProcessor"/>
<bean ref="transactionsFinalizer"/>
<!--2-->
<doCatch>
<exception>java.lang.Exception</exception>
<to uri="file://{{fdr.folder.failed}}"/>
<bean ref="exceptionProcessor"/>
</doCatch>
<doFinally>
<bean ref="responsePublisher"/>
</doFinally>
</doTry>
</route>
必要なロジック: transactionsProcessor と transactionsFinalizer ですべてが正常に処理された場合は、ファイルを「working」フォルダーから「done」フォルダーに移動しました transactionProcessor または transactionsFinalizer でエラーが発生した場合は、ファイルを「working」から「failed」および「done」に移動します行 1 をプレースホルダー 2 に配置すると、カスタム プロセッサで処理した後、ファイルを InputStream として再配置できません。「作業中」から「完了」に移行できるかもしれません。次に、OK の場合はファイルを処理し、OK の場合はファイルを処理します。エラーが発生した場合は、「完了」から「失敗」に移行します。助けてください。