我有一个从中轮询的文件放置端点。我需要在收到文件时按顺序轮询文件,并且我使用 cron 表达式在一天中的特定时间轮询。这是我的文件输入:
file:///tmp/input?idempotent=true&moveFailed=/tmp/error&readLock=changed&readLockCheckInterval=2500&sortBy=file:modified&move=processed/&scheduler=quartz2&scheduler.cron=0+0/5+0-3,5-23+*+*+?
我遇到的问题是骆驼轮询一批文件,但随后更新的文件被写入目录,因此在随后的轮询中,在前一批完成之前处理一个新文件。
我在我的路线中添加了一些属性来显示批量大小以及它是否已经完成只是为了一些信息:
<camel:log message="Camel batch size: $simple{property.CamelBatchSize}, Camel Batch Index: $simple{property.CamelBatchIndex}, Camel Batch finished: $simple{property.CamelBatchComplete}"/>
我怎么能告诉骆驼在上一批完成之前不要轮询?我这样做是因为文件处理的顺序很重要。谢谢!