Hi

Ah this is by design. The file component read lock strategy is per
file, and don't do a "bulk operation".
Also if you want to process files in order (eg maybe sorted) etc, then
you would need to grab the read lock in that order as well.

When we move to Java7 as minimum JDK version, then we can leverage the
NIO2 file watcher API.
It may have some easier API for watching new files being saved to directories.

And btw you should write files using temporary names, and then rename
to final name when done. Then its easier for the other party to pickup
the files as they can match on file name.

Having to use readLock=change is not an ideal way of exchanging files,
as you really don't know when the other party is done writing the
file.



On Wed, Apr 24, 2013 at 9:18 PM, hefiso
<henrik.filtenborg.soren...@gmail.com> wrote:
> Hi
>
> The setting maxMessagesPerPoll is actually respected but the files will only
> be processed one by one with a delay matching readLockTimeout. This
> behaviour is happening because the method acquireExclusiveReadLock in
> FileChangedExclusiveReadLockStrategy effectively calls
> Thread.sleep(checkInterval) for a single file. When using a high setting for
> readLockTimeout, say 10 seconds, then the throughput really suffers.
>
> This is also the case with FileRenameExclusiveReadLockStrategy (since it
> extends GenericFileRenameExclusiveReadLockStrategy<File>) because it also
> calls Thread.sleep when processing a single file.
>
> I don't see a quick fix for this since the Thread.sleep must be performed at
> a higher level than on a single file (i.e. after trying to process all the
> files in the collection given by the poll).
>
> I will log a JIRA shortly.
>
> Best regards
> Henrik
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/File2-maxMessagesPerPoll-combined-with-readLock-changed-tp5731434p5731476.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to