Author: buildbot
Date: Fri Jul 4 13:17:59 2014
New Revision: 914996
Log:
Production update by buildbot for camel
Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/file2.html
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 Fri Jul 4 13:17:59 2014
@@ -115,7 +115,7 @@
</div></div>
<p>. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>idempotentRepository</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> A pluggable repository <a shape="rect"
class="external-link"
href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/IdempotentRepository.html">org.apache.camel.spi.IdempotentRepository</a>
which by default use <code>MemoryMessageIdRepository</code> if none is
specified and <code>idempotent</code> is <code>true</code>.
</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>inProgressRepository</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>memory</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> A pluggable in-progress repository <a
shape="rect" class="external-link"
href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/
camel/spi/IdempotentRepository.html">org.apache.camel.spi.IdempotentRepository</a>.
The in-progress repository is used to account the current in progress files
being consumed. By default a memory based repository is used.
</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>filter</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> Pluggable filter as a
<code>org.apache.camel.component.file.GenericFileFilter</code> class. Will skip
files if filter returns <code>false</code> in its <code>accept()</code> method.
More details in section below. </p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>sorter</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> Pluggable sorter as a <a shape="rect"
class="external-link" href="http://java.sun.com/j2se/1.5.0
/docs/api/java/util/Comparator.html"
rel="nofollow">java.util.Comparator<org.apache.camel.component.file.GenericFile></a>
class. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>sortBy</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> Built-in sort using the <a shape="rect"
href="file-language.html" title="File Language">File Language</a>. Supports
nested sorts, so you can have a sort by file name and as a 2nd group sort by
modified date. See sorting section below for details. </p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p> <code>readLock</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>markerFile</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> Used by consumer, to only poll the files if it has
exclusive read-lock on the file (i.e. the file is not in-progress or being
written). Camel
will wait until the file lock is granted. <br clear="none"
class="atl-forced-newline">
This option provides the build in strategies: <br clear="none"
class="atl-forced-newline"> <code>markerFile</code> Camel creates a marker
file (fileName.camelLock) and then holds a lock on it. This option is
<strong>not</strong> available for the <a shape="rect" href="ftp2.html"
title="FTP2">FTP</a> component. <br clear="none" class="atl-forced-newline">
<code>changed</code> 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. The option
<code>readLockCheckInterval</code> can be used to set the check frequency. This
option is <strong>only</strong> avail for the <a shape="rect" href="ftp2.html"
title="FTP2">FTP</a> component from <strong>Camel 2.8</strong> onwards. Notice
that from <strong>Camel 2.10.1</st
rong> onwards the <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> option
<code>fastExistsCheck</code> can be enabled to speedup this readLock strategy,
if the FTP server support the LIST operation with a full file name (some
servers may not). <br clear="none" class="atl-forced-newline">
<code>fileLock</code> is for using <code>java.nio.channels.FileLock</code>.
This option is <strong>not</strong> 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"> <code>rename</code> 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"> <code>none</code> is for no read locks at all. <br
clear="none" class="atl-forced-newline">
-Notice from <strong>Camel 2.10</strong> onwards the read locks
<code>changed</code>, <code>fileLock</code> and <code>rename</code> will also
use a <code>markerFile</code> 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).
</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>readLockTimeout</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>10000</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> 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 <strong>Camel 2.0</strong>
the default value is 0. Starting with <
strong>Camel 2.1</strong> the default value is 10000. Currently
<code>fileLock</code>, <code>changed</code> and <code>rename</code> support the
timeout. <strong>Notice:</strong> For <a shape="rect" href="ftp2.html"
title="FTP2">FTP</a> the default <code>readLockTimeout</code> value is
<code>20000</code> instead of <code>10000</code>. </p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p>
<code>readLockCheckInterval</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>1000</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <strong>Camel 2.6:</strong> 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
<code>changed</code> 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
<code>readLockCheckInterval</code> is <code>5000</code>. </p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p> <code>readLockMinLength</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>1</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel
2.10.1:</strong> This option applied only for <code>readLock=changed</code>.
This option allows you to configure a minimum file length. By default Camel
expects the file to contain data, and thus the default value is 1. You can set
this option to zero, to allow consuming zero-length files.
</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>readLockLoggingLevel</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>WARN</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <strong>Camel 2.12:</strong> Logging level used when a
read lock could not be acquired. By
default a WARN is logged. You can change this level, for example to OFF to
not have any logging. This option is only applicable for readLock of types:
changed, fileLock, rename. </p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>directoryMustExist</code> </p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> <code>false</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel
2.5:</strong> Similar to <code>startingDirectoryMustExist</code> but this
applies during polling recursive sub directories. </p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p> <code>doneFileName</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel
2.6:</strong> 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 ca
n use dynamic placeholders. The <em>done</em> file is <strong>always</strong>
expected in the same folder as the original file. See <em>using done file</em>
and <em>writing done file</em> sections for examples. </p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p>
<code>exclusiveReadLockStrategy</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> Pluggable read-lock as a
<code>org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy</code>
implementation. </p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>maxMessagesPerPoll</code> </p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> <code>0</code> </p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> 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 th
at 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>. <strong>Notice:</strong> 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
<strong>before</strong> any sorting. For example if you have 100000 files and
use <code>maxMessagesPerPoll=500</code>, then only the first 500 files will be
picked up, and then sorted. You can use the
<code>eagerMaxMessagesPerPoll</code> option and set this to <code>false</code>
to allow to scan all files first and then sort afterwards.
</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>eagerMaxMessagesPerPoll</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>true</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <strong>Camel 2.9.3:</strong
> Allows for controlling whether the limit from
> <code>maxMessagesPerPoll</code> is eager or not. If eager then the limit is
> during the scanning of files. Where as <code>false</code> would scan all
> files, and then perform sorting. Setting this option to <code>false</code>
> allows for sorting 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. </p></td></tr><tr><td colspan="1" rowspan="1"
> class="confluenceTd"><p> <code>minDepth</code> </p></td><td colspan="1"
> rowspan="1" class="confluenceTd"><p> 0 </p></td><td colspan="1" rowspan="1"
> class="confluenceTd"><p> <strong>Camel 2.8</strong>: The minimum depth to
> start processing when recursively processing a directory. Using
> <code>minDepth=1</code> means the base directory. Using
> <code>minDepth=2</code> means the first sub directory. This option is
> supported by <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> consumer
> from <strong>Camel 2.8.2,
2.9</strong> onwards. </p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>maxDepth</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <code>Integer.MAX_VALUE</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel
2.8:</strong> 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 <strong>Camel 2.8.2, 2.9</strong> onwards.
</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>processStrategy</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> A pluggable
<code>org.apache.camel.component.file.GenericFileProcessStrategy</code>
allowing you to implement your own <code>readLock</code> option or similar. Can
also be used when special conditions must be met before a file can be consumed,
suc
h as a special <em>ready</em> file exists. If this option is set then the
<code>readLock</code> option does not apply. </p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p> <code>startingDirectoryMustExist</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>false</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <strong>Camel 2.5:</strong> Whether the starting
directory must exist. Mind that the <code>autoCreate</code> option is default
enabled, which means the starting directory is normally auto created if it
doesn't exist. You can disable <code>autoCreate</code> and enable this to
ensure the starting directory must exist. Will thrown an exception if the
directory doesn't exist. </p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>pollStrategy</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> A pluggabl
e <code>org.apache.camel.spi.PollingConsumerPollStrategy</code> allowing you
to provide your custom implementation to control error handling usually
occurred during the <code>poll</code> operation <strong>before</strong> 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 <code>WARN</code> level and ignore it.
</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>sendEmptyMessageWhenIdle</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <strong>Camel 2.9:</strong> If the polling
consumer did not poll any files, you can enable this option to send an empty
message (no body) ins
tead. </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>consumer.bridgeErrorHandler</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <strong>Camel 2.10:</strong> Allows for
bridging 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 <code>org.apache.camel.spi.ExceptionHandler</code> 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>. </
p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>scheduledExecutorService</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <strong>Camel 2.10:</strong> Allows for configuring a
custom/shared thread pool to use for the consumer. By default each consumer has
its own single threaded thread pool. This option allows you to share a thread
pool among multiple file consumers. </p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p> <code>scheduler</code> </p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel 2.12:</strong>
To use a custom scheduler to trigger the consumer to run. See more details at
<a shape="rect" href="polling-consumer.html" title="Polling Consumer">Polling
Consumer</a>, for example there is a <a shape="rect" href="quartz2.html" title=
"Quartz2">Quartz2</a>, and <a shape="rect" href="spring.html"
title="Spring">Spring</a> based scheduler that supports CRON expressions.
</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>backoffMultiplier</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>0</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <strong>Camel 2.12:</strong> To let the scheduled
polling consumer backoff if there has been a number of subsequent idles/errors
in a row. The multiplier is then the number of polls that will be skipped
before the next actual attempt is happening again. When this option is in use
then <code>backoffIdleThreshold</code> and/or
<code>backoffErrorThreshold</code> must also be configured. See more details at
<a shape="rect" href="polling-consumer.html" title="Polling Consumer">Polling
Consumer</a>. </p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>backoffIdleThreshold</code> </p></td><td col
span="1" rowspan="1" class="confluenceTd"><p> <code>0</code> </p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel 2.12:</strong>
The number of subsequent idle polls that should happen before the
<code>backoffMultipler</code> should kick-in. </p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p> <code>backoffErrorThreshold</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>0</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel
2.12:</strong> The number of subsequent error polls (failed due some error)
that should happen before the <code>backoffMultipler</code> should kick-in.
</p></td></tr></tbody></table>
+Notice from <strong>Camel 2.10</strong> onwards the read locks
<code>changed</code>, <code>fileLock</code> and <code>rename</code> will also
use a <code>markerFile</code> 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).
</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>readLockTimeout</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>10000</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> 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 <strong>Camel 2.0</strong>
the default value is 0. Starting with <
strong>Camel 2.1</strong> the default value is 10000. Currently
<code>fileLock</code>, <code>changed</code> and <code>rename</code> support the
timeout. <strong>Notice:</strong> For <a shape="rect" href="ftp2.html"
title="FTP2">FTP</a> the default <code>readLockTimeout</code> value is
<code>20000</code> instead of <code>10000</code>. </p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p>
<code>readLockCheckInterval</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>1000</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <strong>Camel 2.6:</strong> 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
<code>changed</code> 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
<code>readLockCheckInterval</code> is <code>5000</code>. </p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p> <code>readLockMinLength</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>1</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel
2.10.1:</strong> This option applied only for <code>readLock=changed</code>.
This option allows you to configure a minimum file length. By default Camel
expects the file to contain data, and thus the default value is 1. You can set
this option to zero, to allow consuming zero-length files.
</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>readLockLoggingLevel</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>WARN</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <strong>Camel 2.12:</strong> Logging level used when a
read lock could not be acquired. By
default a WARN is logged. You can change this level, for example to OFF to
not have any logging. This option is only applicable for readLock of types:
changed, fileLock, rename. </p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>readLockMarkerFile</code> </p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> <code>true</code> </p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel 2.14:</strong>
Whether to use marker file with the <code>changed</code>, <code>rename</code>,
or <code>exclusive</code> read lock types. By default a marker file is used as
well to guard against other processes picking up the same files. This behavior
can be turned off by setting this option to <code>false</code>. For example if
you do not want to write marker files to the file systems by the Camel
application. </p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>directoryMustExist</code> </p></td><td
colspan="1" rowspan="1" clas
s="confluenceTd"><p> <code>false</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <strong>Camel 2.5:</strong> Similar to
<code>startingDirectoryMustExist</code> but this applies during polling
recursive sub directories. </p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>doneFileName</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <strong>Camel 2.6:</strong> 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 <strong>always</strong>
expected in the same folder as the original file. See <em>using done file</em>
and <em>writing done file</em> sections for examples. </p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p>
<code>exclusiveReadLockStrategy</code> </
p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Pluggable
read-lock as a
<code>org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy</code>
implementation. </p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>maxMessagesPerPoll</code> </p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> <code>0</code> </p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> 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>. <strong>Notice:</strong> If this option is in use
then the <a shape="rect" href="file2.html" title="File2">File</a> and <a
shape="rect" hre
f="ftp2.html" title="FTP2">FTP</a> components will limit
<strong>before</strong> any sorting. For example if you have 100000 files and
use <code>maxMessagesPerPoll=500</code>, then only the first 500 files will be
picked up, and then sorted. You can use the
<code>eagerMaxMessagesPerPoll</code> option and set this to <code>false</code>
to allow to scan all files first and then sort afterwards.
</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>eagerMaxMessagesPerPoll</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>true</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <strong>Camel 2.9.3:</strong> Allows for controlling
whether the limit from <code>maxMessagesPerPoll</code> is eager or not. If
eager then the limit is during the scanning of files. Where as
<code>false</code> would scan all files, and then perform sorting. Setting this
option to <code>false</code> allows for sorting 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. </p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p> <code>minDepth</code> </p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> 0 </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <strong>Camel 2.8</strong>: The minimum
depth to start processing when recursively processing a directory. Using
<code>minDepth=1</code> means the base directory. Using <code>minDepth=2</code>
means the first sub directory. This option is supported by <a shape="rect"
href="ftp2.html" title="FTP2">FTP</a> consumer from <strong>Camel 2.8.2,
2.9</strong> onwards. </p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>maxDepth</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <code>Integer.MAX_VALUE</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel
2.8:</strong> The maximum depth to trav
erse when recursively processing a directory. This option is supported by <a
shape="rect" href="ftp2.html" title="FTP2">FTP</a> consumer from <strong>Camel
2.8.2, 2.9</strong> onwards. </p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>processStrategy</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> A pluggable
<code>org.apache.camel.component.file.GenericFileProcessStrategy</code>
allowing you to implement your own <code>readLock</code> 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
<code>readLock</code> option does not apply. </p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p> <code>startingDirectoryMustExist</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>false</code> </p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel 2.5:</strong>
Whether the starting directory must exist. Mind that the
<code>autoCreate</code> option is default enabled, which means the starting
directory is normally auto created if it doesn't exist. You can disable
<code>autoCreate</code> and enable this to ensure the starting directory must
exist. Will thrown an exception if the directory doesn't exist.
</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>pollStrategy</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> A pluggable
<code>org.apache.camel.spi.PollingConsumerPollStrategy</code> allowing you to
provide your custom implementation to control error handling usually occurred
during the <code>poll</code> operation <strong>before</strong> an <a
shape="rect" href="exchange.html" title="Exchange">Exchange</a> have been
created and being rout
ed 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 <code>WARN</code> level and ignore it. </p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p>
<code>sendEmptyMessageWhenIdle</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <strong>Camel 2.9:</strong> If the polling
consumer did not poll any files, you can enable this option to send an empty
message (no body) instead. </p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>consumer.bridgeErrorHandler</code> </p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> <code>false</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel
2.10:</strong> Allows for bridging 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
<code>org.apache.camel.spi.ExceptionHandler</code> 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>.
</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>scheduledExecutorService</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <strong>Camel 2.10:</strong> Allows for configuring a
custom/shared thread
pool to use for the consumer. By default each consumer has its own single
threaded thread pool. This option allows you to share a thread pool among
multiple file consumers. </p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>scheduler</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <strong>Camel 2.12:</strong> To use a
custom scheduler to trigger the consumer to run. See more details at <a
shape="rect" href="polling-consumer.html" title="Polling Consumer">Polling
Consumer</a>, for example there is a <a shape="rect" href="quartz2.html"
title="Quartz2">Quartz2</a>, and <a shape="rect" href="spring.html"
title="Spring">Spring</a> based scheduler that supports CRON expressions.
</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>backoffMultiplier</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>0</code> </p></td
><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel
>2.12:</strong> To let the scheduled polling consumer backoff if there has
>been a number of subsequent idles/errors in a row. The multiplier is then the
>number of polls that will be skipped before the next actual attempt is
>happening again. When this option is in use then
><code>backoffIdleThreshold</code> and/or <code>backoffErrorThreshold</code>
>must also be configured. See more details at <a shape="rect"
>href="polling-consumer.html" title="Polling Consumer">Polling Consumer</a>.
></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
><code>backoffIdleThreshold</code> </p></td><td colspan="1" rowspan="1"
>class="confluenceTd"><p> <code>0</code> </p></td><td colspan="1" rowspan="1"
>class="confluenceTd"><p> <strong>Camel 2.12:</strong> The number of
>subsequent idle polls that should happen before the
><code>backoffMultipler</code> should kick-in. </p></td></tr><tr><td
>colspan="1" rowspan="1" class="conflu
enceTd"><p> <code>backoffErrorThreshold</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <code>0</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <strong>Camel 2.12:</strong> The number of
subsequent error polls (failed due some error) that should happen before the
<code>backoffMultipler</code> should kick-in. </p></td></tr></tbody></table>
</div><h4 id="File2-Defaultbehaviorforfileconsumer">Default behavior for file
consumer</h4><ul><li>By default the file is locked for the duration of the
processing.</li><li>After the route has completed, files are moved into the
<code>.camel</code> subdirectory, so that they appear to be
deleted.</li><li>The File Consumer will always skip any file whose name starts
with a dot, such as <code>.</code>, <code>.camel</code>, <code>.m2</code> or
<code>.groovy</code>.</li><li>Only files (not directories) are matched for
valid filename, if options such as: <code>include</code> or
<code>exclude</code> are used.</li></ul><h4
id="File2-Producer">Producer</h4><div class="confluenceTableSmall">
<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh"><p> Name </p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p> Default Value </p></th><th colspan="1" rowspan="1"
class="confluenceTh"><p> Description </p></th></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p> <code>fileExist</code> </p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> <code>Override</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> What to do if a
file already exists with the same name. The following values can be specified:
<strong>Override</strong>, <strong>Append</strong>, <strong>Fail</strong>,
<strong>Ignore</strong>, <strong>Move</strong>, and <strong>TryRename</strong>
(Camel 2.11.1). <code>Override</code>, which is the default, replaces the
existing file. <code>Append</code> adds content to the existing file.
<code>Fail</code> throws a <code>GenericFileOperationException</code>,
indicating that there is already an existin
g file. <code>Ignore</code> silently ignores the problem and <strong>does
not</strong> override the existing file, but assumes everything is okay. The
<code>Move</code> option requires <strong>Camel 2.10.1</strong> onwards, and
the corresponding <code>moveExisting</code> option to be configured as well.
The option <code>eagerDeleteTargetFile</code> can be used to control what to do
if an moving the file, and there exists already an existing file, otherwise
causing the move operation to fail. The <code>Move</code> option will move any
existing files, before writing the target file. <code>TryRename</code>
<strong>Camel 2.11.1</strong> is only applicable if <code>tempFileName</code>
option is in use. This allows to try renaming the file from the temporary name
to the actual name, without doing any exists check. This check may be faster on
some file systems and especially FTP servers. </p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p> <code>tempPrefix</code> </p></td
><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</code>
></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> This option is
>used to write the file using a temporary name and then, after the write is
>complete, rename it to the real name. Can be used to identify files being
>written and also avoid consumers (not using exclusive read locks) reading in
>progress files. Is often used by <a shape="rect" href="ftp2.html"
>title="FTP2">FTP</a> when uploading big files. </p></td></tr><tr><td
>colspan="1" rowspan="1" class="confluenceTd"><p> <code>tempFileName</code>
></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>
><code>null</code> </p></td><td colspan="1" rowspan="1"
>class="confluenceTd"><p> <strong>Camel 2.1:</strong> The
><strong>same</strong> as <code>tempPrefix</code> option but offering a more
>fine grained control on the naming of the temporary filename as it uses the
><a shape="rect" href="file-language.html" title="File Language">File
>Language</a>. </p
></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
><code>moveExisting</code> </p></td><td colspan="1" rowspan="1"
>class="confluenceTd"><p> <code>null</code> </p></td><td colspan="1"
>rowspan="1" class="confluenceTd"><p> <strong>Camel 2.10.1:</strong> <a
>shape="rect" href="expression.html" title="Expression">Expression</a> (such
>as <a shape="rect" href="file-language.html" title="File Language">File
>Language</a>) used to compute file name to use when
><code>fileExist=Move</code> is configured. To move files into a
><code>backup</code> subdirectory just enter <code>backup</code>. This option
>only supports the following <a shape="rect" href="file-language.html"
>title="File Language">File Language</a> tokens: "file:name", "file:name.ext",
>"file:name.noext", "file:onlyname", "file:onlyname.noext", "file:ext", and
>"file:parent". Notice the "file:parent" is not supported by the <a
>shape="rect" href="ftp2.html" title="FTP2">FTP</a> component, as the FTP
>component can only move
any existing files to a relative directory based on current dir as base.
</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>keepLastModified</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>false</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <strong>Camel 2.2:</strong> Will keep the
last modified timestamp from the source file (if any). Will use the
<code>Exchange.FILE_LAST_MODIFIED</code> header to located the timestamp. This
header can contain either a <code>java.util.Date</code> or <code>long</code>
with the timestamp. If the timestamp exists and the option is enabled it will
set this timestamp on the written file. <strong>Note:</strong> This option only
applies to the <strong>file</strong> producer. You <em>cannot</em> use this
option with any of the ftp producers. </p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd"><p> <code>eagerDeleteTargetFile</code>
</p></td><td colspan="1" rowspan="1
" class="confluenceTd"><p> <code>true</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <strong>Camel 2.3:</strong> Whether or not
to eagerly delete any existing target file. This option only applies when you
use <code>fileExists=Override</code> and the <code>tempFileName</code> option
as well. You can use this to disable (set it to false) deleting the target file
before the temp file is written. For example you may write big files and want
the target file to exists during the temp file is being written. This ensure
the target file is only deleted until the very last moment, just before the
temp file is being renamed to the target filename. From <strong>Camel
2.10.1</strong> onwards this option is also used to control whether to delete
any existing files when <code>fileExist=Move</code> is enabled, and an existing
file exists. If this option copyAndDeleteOnRenameFailis false, then an
exception will be thrown if an existing file existed, if its true, then the
exist
ing file is deleted before the move operation. </p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p> <code>doneFileName</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <code>null</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Camel
2.6:</strong> If provided, then Camel will write a 2nd <em>done</em> file when
the original file has been written. The <em>done</em> file will be empty. 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 will
<strong>always</strong> be written in the same folder as the original file. See
<em>writing done file</em> section for examples. </p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p> <code>allowNullBody</code>
</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>
<code>false</code> </p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p> <strong>Camel 2.10.1:</str
ong> Used to specify if a null body is allowed during file writing. If set to
true then an empty file will be created, when set to false, and attempting to
send a null body to the file component, a GenericFileWriteException of 'Cannot
write null body to file.' will be thrown. If the `fileExist` option is set to
'Override', then the file will be truncated, and if set to `append` the file
will remain unchanged. </p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd"><p> <code>forceWrites</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <code>true</code> </p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p> <strong>Camel 2.10.5/2.11:</strong>
Whether to force syncing writes to the file system. You can turn this off if
you do not want this level of guarantee, for example if writing to logs / audit
logs etc; this would yield better performance. </p></td></tr></tbody></table>
</div><h4 id="File2-Defaultbehaviorforfileproducer">Default behavior for file
producer</h4><ul><li>By default it will override any existing file, if one
exist with the same name.</li></ul><h3 id="File2-MoveandDeleteoperations">Move
and Delete operations</h3><p>Any move or delete operations is executed after
(post command) the routing has completed; so during processing of the
<code>Exchange</code> the file is still located in the inbox folder.</p><p>Lets
illustrate this with an example:</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">