Author: buildbot
Date: Sat Jun 2 19:20:56 2012
New Revision: 820011
Log:
Production update by buildbot for camel
Modified:
websites/production/camel/content/book-component-appendix.html
websites/production/camel/content/book-in-one-page.html
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/file2.html
Modified: websites/production/camel/content/book-component-appendix.html
==============================================================================
--- websites/production/camel/content/book-component-appendix.html (original)
+++ websites/production/camel/content/book-component-appendix.html Sat Jun 2
19:20:56 2012
@@ -3654,7 +3654,8 @@ This option provides the build in strate
<br clear="none" class="atl-forced-newline"> <tt>changed</tt> is using file
length/modification timestamp to detect whether the file is currently being
copied or not. Will at least use 1 sec. to determine this, so this option
cannot consume files as fast as the others, but can be more reliable as the JDK
IO API cannot always determine whether a file is currently being used by
another process. This option is <b>only</b> avail for the <a shape="rect"
href="ftp2.html" title="FTP2">FTP</a> component from <b>Camel 2.8</b> onwards.
<br clear="none" class="atl-forced-newline"> <tt>fileLock</tt> is for using
<tt>java.nio.channels.FileLock</tt>. This option is <b>not</b> avail for the <a
shape="rect" href="ftp2.html" title="FTP2">FTP</a> component. This approach
should be avoided when accessing a remote file system via a mount/share unless
that file system supports distributed file locks.
<br clear="none" class="atl-forced-newline"> <tt>rename</tt> is for using a
try to rename the file as a test if we can get exclusive read-lock.
-<br clear="none" class="atl-forced-newline"> <tt>none</tt> is for no read
locks at all.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
<tt>readLockTimeout</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"><ul class="alternate" type="square"><li></li></ul>
+<br clear="none" class="atl-forced-newline"> <tt>none</tt> is for no read
locks at all.<br clear="none">
+Notice from <b>Camel 2.10</b> onwards the read locks <tt>changed</tt>,
<tt>fileLock</tt> and <tt>rename</tt> will also use a <tt>markerFile</tt> as
well, to ensure not picking up files that may be in process by another Camel
consumer running on another node (eg cluster). This is only supported by the
file component (not the ftp component). </td></tr><tr><td></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"> <tt>readLockTimeout</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"><ul class="alternate"
type="square"><li></li></ul>
</td><td colspan="1" rowspan="1" class="confluenceTd"> Optional timeout in
millis for the read-lock, if supported by the read-lock. If the read-lock could
not be granted and the timeout triggered, then Camel will skip the file. At
next poll Camel, will try the file again, and this time maybe the read-lock
could be granted. Use a value of 0 or lower to indicate forever. In <b>Camel
2.0</b> the default value is 0. In <b>Camel 2.1</b> the default value is 10000.
Currently <tt>fileLock</tt>, <tt>changed</tt> and <tt>rename</tt> support the
timeout. For <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> the default
<tt>readLockTimeout</tt> value is 20000. </td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>readLockCheckInterval</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> <tt>1000</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.6:</b> Interval in
millis for the read-lock, if supported by the read lock. This interval is used
for sleeping between attempts to acquire the read lock. For example when
using the <tt>changed</tt> read lock, you can set a higher interval period to
cater for <em>slow writes</em>. The default of 1 sec. may be <em>too fast</em>
if the producer is very slow writing the file. For <a shape="rect"
href="ftp2.html" title="FTP2">FTP</a> the default
<tt>readLockCheckInterval</tt> is <tt>5000</tt>. </td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>directoryMustExist</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.5:</b> Similar to
<tt>startingDirectoryMustExist</tt> but this applies during polling recursive
sub directories. </td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>doneFileName</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <b>Camel 2.6:</b> If provided, Camel will
only consume files if a <em>done</em> file exists. This option configures
what file name to use. Either you can specify a fixed name. Or you can use
dynamic placeholders. The <em>done</em> file is <b>always</b> expected in the
same folder as the original file. See <em>using done file</em> and <em>writing
done file</em> sections for examples. </td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>exclusiveReadLockStrategy</tt> </td><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1"
rowspan="1" class="confluenceTd"> Pluggable read-lock as a
<tt>org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy</tt>
implementation. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
<tt>maxMessagesPerPoll</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>0</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> An integer to define a maximum messages to gather per
poll. By default no maximum is set.
Can be used to set a limit of e.g. 1000 to avoid when starting up the server
that there are thousands of files. Set a value of 0 or negative to disabled it.
See more details at <a shape="rect" href="batch-consumer.html" title="Batch
Consumer">Batch Consumer</a>. <b>Notice:</b> If this option is in use then the
<a shape="rect" href="file2.html" title="File2">File</a> and <a shape="rect"
href="ftp2.html" title="FTP2">FTP</a> components will limit <b>before</b> any
sorting. For example if you have 100000 files and use
<tt>maxMessagesPerPoll=500</tt>, then only the first 500 files will be picked
up, and then sorted. You can use the <tt>eagerMaxMessagesPerPoll</tt> option
and set this to <tt>false</tt> to allow to scan all files first and then sort
afterwards. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
<tt>eagerMaxMessagesPerPoll</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>true</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <
b>Camel 2.9.3:</b> Allows to control whether the limit from
<tt>maxMessagesPerPoll</tt> is eager or not. If eager then the limit is during
the scanning of files. Where as <tt>false</tt> would scan all files, and then
perform sorting. Setting this option to <tt>false</tt> allows to sort all files
first, and then limit the poll. Mind that this requires a higher memory usage
as all file details are in memory to perform the sorting. </td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"> <tt>minDepth</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> 0 </td><td colspan="1"
rowspan="1" class="confluenceTd"> <b>Camel 2.8</b>: The minimum depth to start
processing when recursively processing a directory. Using <tt>minDepth=1</tt>
means the base directory. Using <tt>minDepth=2</tt> means the first sub
directory. This option is supported by <a shape="rect" href="ftp2.html"
title="FTP2">FTP</a> consumer from <b>Camel 2.8.2, 2.9</b> onwards.
</td></tr><tr><td colspan="
1" rowspan="1" class="confluenceTd"> <tt>maxDepth</tt> </td><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>Integer.MAX_VALUE</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.8:</b> The maximum
depth to traverse when recursively processing a directory. This option is
supported by <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> consumer
from <b>Camel 2.8.2, 2.9</b> onwards. </td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>processStrategy</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> A pluggable
<tt>org.apache.camel.component.file.GenericFileProcessStrategy</tt> allowing
you to implement your own <tt>readLock</tt> option or similar. Can also be used
when special conditions must be met before a file can be consumed, such as a
special <em>ready</em> file exists. If this option is set then the
<tt>readLock</tt> option does not apply. </td></tr><t
r><td colspan="1" rowspan="1" class="confluenceTd">
<tt>startingDirectoryMustExist</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <b>Camel 2.5:</b> Whether the starting directory must
exist. Mind that the <tt>autoCreate</tt> option is default enabled, which means
the starting directory is normally auto created if it doesn't exist. You can
disable <tt>autoCreate</tt> and enable this to ensure the starting directory
must exist. Will thrown an exception if the directory doesn't exist.
</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
<tt>pollStrategy</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">
<tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel
2.0:</b> A pluggable <tt>org.apache.camel.PollingConsumerPollStrategy</tt>
allowing you to provide your custom implementation to control error handling
usually occurred during the <tt>poll</tt> operat
ion <b>before</b> an <a shape="rect" href="exchange.html"
title="Exchange">Exchange</a> have been created and being routed in Camel. In
other words the error occurred while the polling was gathering information, for
instance access to a file network failed so Camel cannot access it to scan for
files. The default implementation will log the caused exception at
<tt>WARN</tt> level and ignore it. </td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>sendEmptyMessageWhenIdle</tt> </td><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1"
rowspan="1" class="confluenceTd"> <b>Camel 2.9:</b> If the polling consumer did
not poll any files, you can enable this option to send an empty message (no
body) instead. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
<tt>consumer.bridgeErrorHandler</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <b>Cam
el 2.10:</b> Allows to bridge the consumer to the Camel routing <a
shape="rect" href="error-handler.html" title="Error Handler">Error Handler</a>,
which mean any exceptions occurred while trying to pickup files, or the likes,
will now be processed as a message and handled by the routing <a shape="rect"
href="error-handler.html" title="Error Handler">Error Handler</a>. By default
the consumer will use the <tt>org.apache.camel.spi.ExceptionHandler</tt> to
deal with exceptions, that by default will be logged at WARN/ERROR level and
ignored. See further below on this page fore more details, at section <em>How
to use the Camel error handler to deal with exceptions triggered outside the
routing engine</em>. </td></tr></tbody></table>
</div>
</div>
@@ -4371,7 +4372,7 @@ sortBy=date:file:yyyyMMdd;reverse:file:n
For instance lets assume a system writes a file in a folder you should
consume. But you should not start consuming the file before another
<em>ready</em> file has been written as well.</p>
<p>So by implementing our own <tt>GenericFileProcessStrategy</tt> we can
implement this as:</p>
-<ul class="alternate" type="square"><li>In the <tt>begin()</tt> method we can
test whether the special <em>ready</em> file exists. The begin method returns a
<tt>boolean</tt> to indicate if we can consume the file or not.</li><li>in the
<tt>commit()</tt> method we can move the actual file and also delete the
<em>ready</em> file.</li></ul>
+<ul class="alternate" type="square"><li>In the <tt>begin()</tt> method we can
test whether the special <em>ready</em> file exists. The begin method returns a
<tt>boolean</tt> to indicate if we can consume the file or not.</li><li>In the
<tt>abort()</tt> method (Camel 2.10) special logic can be executed in case the
<tt>begin</tt> operation returned <tt>false</tt>, for example to cleanup
resources etc.</li><li>in the <tt>commit()</tt> method we can move the actual
file and also delete the <em>ready</em> file.</li></ul>
<h3><a shape="rect" name="BookComponentAppendix-Usingfilter"></a>Using
filter</h3>
Modified: websites/production/camel/content/book-in-one-page.html
==============================================================================
--- websites/production/camel/content/book-in-one-page.html (original)
+++ websites/production/camel/content/book-in-one-page.html Sat Jun 2 19:20:56
2012
@@ -24063,7 +24063,8 @@ This option provides the build in strate
<br clear="none" class="atl-forced-newline"> <tt>changed</tt> is using file
length/modification timestamp to detect whether the file is currently being
copied or not. Will at least use 1 sec. to determine this, so this option
cannot consume files as fast as the others, but can be more reliable as the JDK
IO API cannot always determine whether a file is currently being used by
another process. This option is <b>only</b> avail for the <a shape="rect"
href="ftp2.html" title="FTP2">FTP</a> component from <b>Camel 2.8</b> onwards.
<br clear="none" class="atl-forced-newline"> <tt>fileLock</tt> is for using
<tt>java.nio.channels.FileLock</tt>. This option is <b>not</b> avail for the <a
shape="rect" href="ftp2.html" title="FTP2">FTP</a> component. This approach
should be avoided when accessing a remote file system via a mount/share unless
that file system supports distributed file locks.
<br clear="none" class="atl-forced-newline"> <tt>rename</tt> is for using a
try to rename the file as a test if we can get exclusive read-lock.
-<br clear="none" class="atl-forced-newline"> <tt>none</tt> is for no read
locks at all.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
<tt>readLockTimeout</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"><ul class="alternate" type="square"><li></li></ul>
+<br clear="none" class="atl-forced-newline"> <tt>none</tt> is for no read
locks at all.<br clear="none">
+Notice from <b>Camel 2.10</b> onwards the read locks <tt>changed</tt>,
<tt>fileLock</tt> and <tt>rename</tt> will also use a <tt>markerFile</tt> as
well, to ensure not picking up files that may be in process by another Camel
consumer running on another node (eg cluster). This is only supported by the
file component (not the ftp component). </td></tr><tr><td></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"> <tt>readLockTimeout</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"><ul class="alternate"
type="square"><li></li></ul>
</td><td colspan="1" rowspan="1" class="confluenceTd"> Optional timeout in
millis for the read-lock, if supported by the read-lock. If the read-lock could
not be granted and the timeout triggered, then Camel will skip the file. At
next poll Camel, will try the file again, and this time maybe the read-lock
could be granted. Use a value of 0 or lower to indicate forever. In <b>Camel
2.0</b> the default value is 0. In <b>Camel 2.1</b> the default value is 10000.
Currently <tt>fileLock</tt>, <tt>changed</tt> and <tt>rename</tt> support the
timeout. For <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> the default
<tt>readLockTimeout</tt> value is 20000. </td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>readLockCheckInterval</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> <tt>1000</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.6:</b> Interval in
millis for the read-lock, if supported by the read lock. This interval is used
for sleeping between attempts to acquire the read lock. For example when
using the <tt>changed</tt> read lock, you can set a higher interval period to
cater for <em>slow writes</em>. The default of 1 sec. may be <em>too fast</em>
if the producer is very slow writing the file. For <a shape="rect"
href="ftp2.html" title="FTP2">FTP</a> the default
<tt>readLockCheckInterval</tt> is <tt>5000</tt>. </td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>directoryMustExist</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.5:</b> Similar to
<tt>startingDirectoryMustExist</tt> but this applies during polling recursive
sub directories. </td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>doneFileName</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <b>Camel 2.6:</b> If provided, Camel will
only consume files if a <em>done</em> file exists. This option configures
what file name to use. Either you can specify a fixed name. Or you can use
dynamic placeholders. The <em>done</em> file is <b>always</b> expected in the
same folder as the original file. See <em>using done file</em> and <em>writing
done file</em> sections for examples. </td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>exclusiveReadLockStrategy</tt> </td><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1"
rowspan="1" class="confluenceTd"> Pluggable read-lock as a
<tt>org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy</tt>
implementation. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
<tt>maxMessagesPerPoll</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>0</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> An integer to define a maximum messages to gather per
poll. By default no maximum is set.
Can be used to set a limit of e.g. 1000 to avoid when starting up the server
that there are thousands of files. Set a value of 0 or negative to disabled it.
See more details at <a shape="rect" href="batch-consumer.html" title="Batch
Consumer">Batch Consumer</a>. <b>Notice:</b> If this option is in use then the
<a shape="rect" href="file2.html" title="File2">File</a> and <a shape="rect"
href="ftp2.html" title="FTP2">FTP</a> components will limit <b>before</b> any
sorting. For example if you have 100000 files and use
<tt>maxMessagesPerPoll=500</tt>, then only the first 500 files will be picked
up, and then sorted. You can use the <tt>eagerMaxMessagesPerPoll</tt> option
and set this to <tt>false</tt> to allow to scan all files first and then sort
afterwards. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
<tt>eagerMaxMessagesPerPoll</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>true</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <
b>Camel 2.9.3:</b> Allows to control whether the limit from
<tt>maxMessagesPerPoll</tt> is eager or not. If eager then the limit is during
the scanning of files. Where as <tt>false</tt> would scan all files, and then
perform sorting. Setting this option to <tt>false</tt> allows to sort all files
first, and then limit the poll. Mind that this requires a higher memory usage
as all file details are in memory to perform the sorting. </td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"> <tt>minDepth</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> 0 </td><td colspan="1"
rowspan="1" class="confluenceTd"> <b>Camel 2.8</b>: The minimum depth to start
processing when recursively processing a directory. Using <tt>minDepth=1</tt>
means the base directory. Using <tt>minDepth=2</tt> means the first sub
directory. This option is supported by <a shape="rect" href="ftp2.html"
title="FTP2">FTP</a> consumer from <b>Camel 2.8.2, 2.9</b> onwards.
</td></tr><tr><td colspan="
1" rowspan="1" class="confluenceTd"> <tt>maxDepth</tt> </td><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>Integer.MAX_VALUE</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.8:</b> The maximum
depth to traverse when recursively processing a directory. This option is
supported by <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> consumer
from <b>Camel 2.8.2, 2.9</b> onwards. </td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>processStrategy</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> A pluggable
<tt>org.apache.camel.component.file.GenericFileProcessStrategy</tt> allowing
you to implement your own <tt>readLock</tt> option or similar. Can also be used
when special conditions must be met before a file can be consumed, such as a
special <em>ready</em> file exists. If this option is set then the
<tt>readLock</tt> option does not apply. </td></tr><t
r><td colspan="1" rowspan="1" class="confluenceTd">
<tt>startingDirectoryMustExist</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <b>Camel 2.5:</b> Whether the starting directory must
exist. Mind that the <tt>autoCreate</tt> option is default enabled, which means
the starting directory is normally auto created if it doesn't exist. You can
disable <tt>autoCreate</tt> and enable this to ensure the starting directory
must exist. Will thrown an exception if the directory doesn't exist.
</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
<tt>pollStrategy</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">
<tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel
2.0:</b> A pluggable <tt>org.apache.camel.PollingConsumerPollStrategy</tt>
allowing you to provide your custom implementation to control error handling
usually occurred during the <tt>poll</tt> operat
ion <b>before</b> an <a shape="rect" href="exchange.html"
title="Exchange">Exchange</a> have been created and being routed in Camel. In
other words the error occurred while the polling was gathering information, for
instance access to a file network failed so Camel cannot access it to scan for
files. The default implementation will log the caused exception at
<tt>WARN</tt> level and ignore it. </td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>sendEmptyMessageWhenIdle</tt> </td><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1"
rowspan="1" class="confluenceTd"> <b>Camel 2.9:</b> If the polling consumer did
not poll any files, you can enable this option to send an empty message (no
body) instead. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
<tt>consumer.bridgeErrorHandler</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <b>Cam
el 2.10:</b> Allows to bridge the consumer to the Camel routing <a
shape="rect" href="error-handler.html" title="Error Handler">Error Handler</a>,
which mean any exceptions occurred while trying to pickup files, or the likes,
will now be processed as a message and handled by the routing <a shape="rect"
href="error-handler.html" title="Error Handler">Error Handler</a>. By default
the consumer will use the <tt>org.apache.camel.spi.ExceptionHandler</tt> to
deal with exceptions, that by default will be logged at WARN/ERROR level and
ignored. See further below on this page fore more details, at section <em>How
to use the Camel error handler to deal with exceptions triggered outside the
routing engine</em>. </td></tr></tbody></table>
</div>
</div>
@@ -24780,7 +24781,7 @@ sortBy=date:file:yyyyMMdd;reverse:file:n
For instance lets assume a system writes a file in a folder you should
consume. But you should not start consuming the file before another
<em>ready</em> file has been written as well.</p>
<p>So by implementing our own <tt>GenericFileProcessStrategy</tt> we can
implement this as:</p>
-<ul class="alternate" type="square"><li>In the <tt>begin()</tt> method we can
test whether the special <em>ready</em> file exists. The begin method returns a
<tt>boolean</tt> to indicate if we can consume the file or not.</li><li>in the
<tt>commit()</tt> method we can move the actual file and also delete the
<em>ready</em> file.</li></ul>
+<ul class="alternate" type="square"><li>In the <tt>begin()</tt> method we can
test whether the special <em>ready</em> file exists. The begin method returns a
<tt>boolean</tt> to indicate if we can consume the file or not.</li><li>In the
<tt>abort()</tt> method (Camel 2.10) special logic can be executed in case the
<tt>begin</tt> operation returned <tt>false</tt>, for example to cleanup
resources etc.</li><li>in the <tt>commit()</tt> method we can move the actual
file and also delete the <em>ready</em> file.</li></ul>
<h3><a shape="rect" name="BookInOnePage-Usingfilter"></a>Using filter</h3>
Modified: websites/production/camel/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.
Modified: websites/production/camel/content/file2.html
==============================================================================
--- websites/production/camel/content/file2.html (original)
+++ websites/production/camel/content/file2.html Sat Jun 2 19:20:56 2012
@@ -121,7 +121,8 @@ This option provides the build in strate
<br clear="none" class="atl-forced-newline"> <tt>changed</tt> is using file
length/modification timestamp to detect whether the file is currently being
copied or not. Will at least use 1 sec. to determine this, so this option
cannot consume files as fast as the others, but can be more reliable as the JDK
IO API cannot always determine whether a file is currently being used by
another process. This option is <b>only</b> avail for the <a shape="rect"
href="ftp2.html" title="FTP2">FTP</a> component from <b>Camel 2.8</b> onwards.
<br clear="none" class="atl-forced-newline"> <tt>fileLock</tt> is for using
<tt>java.nio.channels.FileLock</tt>. This option is <b>not</b> avail for the <a
shape="rect" href="ftp2.html" title="FTP2">FTP</a> component. This approach
should be avoided when accessing a remote file system via a mount/share unless
that file system supports distributed file locks.
<br clear="none" class="atl-forced-newline"> <tt>rename</tt> is for using a
try to rename the file as a test if we can get exclusive read-lock.
-<br clear="none" class="atl-forced-newline"> <tt>none</tt> is for no read
locks at all.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
<tt>readLockTimeout</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"><ul class="alternate" type="square"><li></li></ul>
+<br clear="none" class="atl-forced-newline"> <tt>none</tt> is for no read
locks at all.<br clear="none">
+Notice from <b>Camel 2.10</b> onwards the read locks <tt>changed</tt>,
<tt>fileLock</tt> and <tt>rename</tt> will also use a <tt>markerFile</tt> as
well, to ensure not picking up files that may be in process by another Camel
consumer running on another node (eg cluster). This is only supported by the
file component (not the ftp component). </td></tr><tr><td></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"> <tt>readLockTimeout</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"><ul class="alternate"
type="square"><li></li></ul>
</td><td colspan="1" rowspan="1" class="confluenceTd"> Optional timeout in
millis for the read-lock, if supported by the read-lock. If the read-lock could
not be granted and the timeout triggered, then Camel will skip the file. At
next poll Camel, will try the file again, and this time maybe the read-lock
could be granted. Use a value of 0 or lower to indicate forever. In <b>Camel
2.0</b> the default value is 0. In <b>Camel 2.1</b> the default value is 10000.
Currently <tt>fileLock</tt>, <tt>changed</tt> and <tt>rename</tt> support the
timeout. For <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> the default
<tt>readLockTimeout</tt> value is 20000. </td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>readLockCheckInterval</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> <tt>1000</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.6:</b> Interval in
millis for the read-lock, if supported by the read lock. This interval is used
for sleeping between attempts to acquire the read lock. For example when
using the <tt>changed</tt> read lock, you can set a higher interval period to
cater for <em>slow writes</em>. The default of 1 sec. may be <em>too fast</em>
if the producer is very slow writing the file. For <a shape="rect"
href="ftp2.html" title="FTP2">FTP</a> the default
<tt>readLockCheckInterval</tt> is <tt>5000</tt>. </td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>directoryMustExist</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.5:</b> Similar to
<tt>startingDirectoryMustExist</tt> but this applies during polling recursive
sub directories. </td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>doneFileName</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <b>Camel 2.6:</b> If provided, Camel will
only consume files if a <em>done</em> file exists. This option configures
what file name to use. Either you can specify a fixed name. Or you can use
dynamic placeholders. The <em>done</em> file is <b>always</b> expected in the
same folder as the original file. See <em>using done file</em> and <em>writing
done file</em> sections for examples. </td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>exclusiveReadLockStrategy</tt> </td><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1"
rowspan="1" class="confluenceTd"> Pluggable read-lock as a
<tt>org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy</tt>
implementation. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
<tt>maxMessagesPerPoll</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>0</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> An integer to define a maximum messages to gather per
poll. By default no maximum is set.
Can be used to set a limit of e.g. 1000 to avoid when starting up the server
that there are thousands of files. Set a value of 0 or negative to disabled it.
See more details at <a shape="rect" href="batch-consumer.html" title="Batch
Consumer">Batch Consumer</a>. <b>Notice:</b> If this option is in use then the
<a shape="rect" href="file2.html" title="File2">File</a> and <a shape="rect"
href="ftp2.html" title="FTP2">FTP</a> components will limit <b>before</b> any
sorting. For example if you have 100000 files and use
<tt>maxMessagesPerPoll=500</tt>, then only the first 500 files will be picked
up, and then sorted. You can use the <tt>eagerMaxMessagesPerPoll</tt> option
and set this to <tt>false</tt> to allow to scan all files first and then sort
afterwards. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
<tt>eagerMaxMessagesPerPoll</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>true</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <
b>Camel 2.9.3:</b> Allows to control whether the limit from
<tt>maxMessagesPerPoll</tt> is eager or not. If eager then the limit is during
the scanning of files. Where as <tt>false</tt> would scan all files, and then
perform sorting. Setting this option to <tt>false</tt> allows to sort all files
first, and then limit the poll. Mind that this requires a higher memory usage
as all file details are in memory to perform the sorting. </td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"> <tt>minDepth</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> 0 </td><td colspan="1"
rowspan="1" class="confluenceTd"> <b>Camel 2.8</b>: The minimum depth to start
processing when recursively processing a directory. Using <tt>minDepth=1</tt>
means the base directory. Using <tt>minDepth=2</tt> means the first sub
directory. This option is supported by <a shape="rect" href="ftp2.html"
title="FTP2">FTP</a> consumer from <b>Camel 2.8.2, 2.9</b> onwards.
</td></tr><tr><td colspan="
1" rowspan="1" class="confluenceTd"> <tt>maxDepth</tt> </td><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>Integer.MAX_VALUE</tt> </td><td
colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.8:</b> The maximum
depth to traverse when recursively processing a directory. This option is
supported by <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> consumer
from <b>Camel 2.8.2, 2.9</b> onwards. </td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>processStrategy</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> A pluggable
<tt>org.apache.camel.component.file.GenericFileProcessStrategy</tt> allowing
you to implement your own <tt>readLock</tt> option or similar. Can also be used
when special conditions must be met before a file can be consumed, such as a
special <em>ready</em> file exists. If this option is set then the
<tt>readLock</tt> option does not apply. </td></tr><t
r><td colspan="1" rowspan="1" class="confluenceTd">
<tt>startingDirectoryMustExist</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <b>Camel 2.5:</b> Whether the starting directory must
exist. Mind that the <tt>autoCreate</tt> option is default enabled, which means
the starting directory is normally auto created if it doesn't exist. You can
disable <tt>autoCreate</tt> and enable this to ensure the starting directory
must exist. Will thrown an exception if the directory doesn't exist.
</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
<tt>pollStrategy</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">
<tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel
2.0:</b> A pluggable <tt>org.apache.camel.PollingConsumerPollStrategy</tt>
allowing you to provide your custom implementation to control error handling
usually occurred during the <tt>poll</tt> operat
ion <b>before</b> an <a shape="rect" href="exchange.html"
title="Exchange">Exchange</a> have been created and being routed in Camel. In
other words the error occurred while the polling was gathering information, for
instance access to a file network failed so Camel cannot access it to scan for
files. The default implementation will log the caused exception at
<tt>WARN</tt> level and ignore it. </td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>sendEmptyMessageWhenIdle</tt> </td><td colspan="1"
rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1"
rowspan="1" class="confluenceTd"> <b>Camel 2.9:</b> If the polling consumer did
not poll any files, you can enable this option to send an empty message (no
body) instead. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
<tt>consumer.bridgeErrorHandler</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1"
class="confluenceTd"> <b>Cam
el 2.10:</b> Allows to bridge the consumer to the Camel routing <a
shape="rect" href="error-handler.html" title="Error Handler">Error Handler</a>,
which mean any exceptions occurred while trying to pickup files, or the likes,
will now be processed as a message and handled by the routing <a shape="rect"
href="error-handler.html" title="Error Handler">Error Handler</a>. By default
the consumer will use the <tt>org.apache.camel.spi.ExceptionHandler</tt> to
deal with exceptions, that by default will be logged at WARN/ERROR level and
ignored. See further below on this page fore more details, at section <em>How
to use the Camel error handler to deal with exceptions triggered outside the
routing engine</em>. </td></tr></tbody></table>
</div>
</div>
@@ -838,7 +839,7 @@ sortBy=date:file:yyyyMMdd;reverse:file:n
For instance lets assume a system writes a file in a folder you should
consume. But you should not start consuming the file before another
<em>ready</em> file has been written as well.</p>
<p>So by implementing our own <tt>GenericFileProcessStrategy</tt> we can
implement this as:</p>
-<ul class="alternate" type="square"><li>In the <tt>begin()</tt> method we can
test whether the special <em>ready</em> file exists. The begin method returns a
<tt>boolean</tt> to indicate if we can consume the file or not.</li><li>in the
<tt>commit()</tt> method we can move the actual file and also delete the
<em>ready</em> file.</li></ul>
+<ul class="alternate" type="square"><li>In the <tt>begin()</tt> method we can
test whether the special <em>ready</em> file exists. The begin method returns a
<tt>boolean</tt> to indicate if we can consume the file or not.</li><li>In the
<tt>abort()</tt> method (Camel 2.10) special logic can be executed in case the
<tt>begin</tt> operation returned <tt>false</tt>, for example to cleanup
resources etc.</li><li>in the <tt>commit()</tt> method we can move the actual
file and also delete the <em>ready</em> file.</li></ul>
<h3><a shape="rect" name="File2-Usingfilter"></a>Using filter</h3>