You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by alexey-s <al...@mail.ru> on 2015/04/24 15:00:47 UTC

Propose change eagerMaxMessagesPerPoll in file/ftp consumers

I propose to extend the value eagerMaxMessagesPerPoll in file/ftp consumers.

eagerMaxMessagesPerPoll = true
eagerMaxMessagesPerPoll = false
eagerMaxMessagesPerPoll = reach
eagerMaxMessagesPerPoll = overcome

The values ​​of "reach" and "overcome" give a chance to correct sorting of
files in a single directory.

Get a list of files in a directory.
  files = operations.listFiles();

For values ​​of "true" and "false", a model of behavior remains the same.

eagerMaxMessagesPerPoll = reach
First filter the files. If the number of files in a directory exceeds the
limit (maxMessagesPerPoll) and to read the list is empty, stop at the limit.
If the total number of the previously selected files in the current
directory and the value exceeds maxMessagesPerPoll, exit the method
doPollDirectory with the result false.
If you have not reached the limit (maxMessagesPerPoll), add files to the
general list. Treat subdirectories.

eagerMaxMessagesPerPoll = overcome
First filter the files. Adding files to the general list. If the limit is
reached or exceeded (maxMessagesPerPoll), exit the method doPollDirectory
with the result false.
If you have not reached the limit (maxMessagesPerPoll), treat
subdirectories.


---
Aleksey



--
View this message in context: http://camel.465427.n5.nabble.com/Propose-change-eagerMaxMessagesPerPoll-in-file-ftp-consumers-tp5766299.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Propose change eagerMaxMessagesPerPoll in file/ftp consumers

Posted by alexey-s <al...@mail.ru>.
I tried to implement a mechanism to limit the list of files.
If the system is switched to the third depth of the file system, it is
necessary to process all the files and subdirectories.
For this purpose, it is necessary to register the new component.
An example implementation is shown below



Why, instead of overriding heap classes do not use the mechanism of the
strategy?
Create a new interface strategy. Add ability to specify their
implementation.


---
Aleksey




--
View this message in context: http://camel.465427.n5.nabble.com/Propose-change-eagerMaxMessagesPerPoll-in-file-ftp-consumers-tp5766299p5766381.html
Sent from the Camel - Users mailing list archive at Nabble.com.