2

私はApache Camel 2.11.1を使用しています

そのようなルートを持っています:

from("file:///somewhere/").
 threads(20).
 to("direct:process")

この例外が発生することがあります:org.apache.camel.InvalidPayloadExceptionメッセージ付き

No body available of type: java.io.InputStream but has value: GenericFile[/somewhere/file.txt] of type: 
org.apache.camel.component.file.GenericFile on: file.txt. Caused by: Error during type conversion from type: 
org.apache.camel.component.file.GenericFile to the required type: byte[] with value GenericFile[/somewhere/file.txt] 
due java.io.FileNotFoundException: /somewhere/file.txt (No such file or directory). 

ディレクトリに多数の .camelLock ファイルが表示されているため、これは、同じファイルを処理しようとするスレッドが少ないために発生すると考えられます。それを避ける方法は?

更新 1

scheduledExecutorServiceを使用して削除しようとしましthreads(20)た。失うファイルは減っているようですが、まだ失われています。回避する方法は?どんな助けでも大歓迎です。

4

1 に答える 1