shashank created CAMEL-25772:
--------------------------------
Summary: camel-file - GenericFileKeptDoneFiles.startBatch removes
the listed done files when the listing was cut, and the consumer keeps them
again at once
Key: CAMEL-25772
URL: https://issues.apache.org/jira/browse/CAMEL-25772
Project: Camel
Issue Type: Improvement
Components: camel-file
Reporter: shashank
Assignee: shashank
Follow-up to the review of CAMEL-25728 (apache/camel#28035, merged).
When the listing of a poll is cut at {{maxMessagesPerPoll}},
{{GenericFileKeptDoneFiles.startBatch(listedDoneFiles, false)}} removes the
listed done files from the kept set ({{kept.removeAll(listedDoneFiles)}}), and
{{GenericFileConsumer.poll}} then calls {{kept.keep}} on every listed done file
right after. The removal is undone at once, so the code does not say what
happens (review comment by Claus Ibsen on the PR).
*Change*: {{startBatch}} leaves the kept done files as they are when the
listing was cut, and its javadoc says that the caller then keeps the done file
of every listed file. The kept set after the poll is the same as before (the
done files kept before plus the listed ones), so the behaviour is unchanged.
The only difference is that a listed done file is no longer out of the kept set
for the short time between {{startBatch}} and the keeps.
*Tests*: no new test (no behaviour change). Existing done-file tests of
camel-core, including {{FileConsumerDoneFileNameFilesLeftTest}} added by
CAMEL-25728: 41 run, 0 failures in 19 classes ({{*DoneFile*Test}}, among them
the 14 tests of {{FileConsumerDoneFileNameFilesLeftTest}}).
_Filed with Claude Code on behalf of allthingssecurity._
--
This message was sent by Atlassian Jira
(v8.20.10#820010)