From df8ede83ea88e5b19aa2cf5de34f69bba05dbfef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bedn=C3=A1=C5=99?= Date: Mon, 2 Sep 2019 02:42:10 +0200 Subject: [PATCH] CAMEL-13920: Allow using markup in option description --- .../src/main/docs/file-component.adoc | 21 ++- .../component/file/GenericFileEndpoint.java | 51 ++++--- .../src/main/docs/ftp-component.adoc | 4 +- .../src/main/docs/ftps-component.adoc | 4 +- .../src/main/docs/sftp-component.adoc | 4 +- .../dsl/FileEndpointBuilderFactory.java | 126 ++++++++++-------- .../dsl/FtpEndpointBuilderFactory.java | 50 +++---- .../dsl/FtpsEndpointBuilderFactory.java | 50 +++---- .../dsl/SftpEndpointBuilderFactory.java | 50 +++---- .../modules/ROOT/pages/file-component.adoc | 21 ++- .../modules/ROOT/pages/ftp-component.adoc | 4 +- .../modules/ROOT/pages/ftps-component.adoc | 4 +- .../modules/ROOT/pages/sftp-component.adoc | 4 +- .../src/main/resources/component-options.mvel | 4 +- .../main/resources/dataformat-options.mvel | 4 +- .../src/main/resources/eip-options.mvel | 4 +- .../src/main/resources/endpoint-options.mvel | 8 +- .../src/main/resources/language-options.mvel | 4 +- 18 files changed, 229 insertions(+), 188 deletions(-) diff --git a/components/camel-file/src/main/docs/file-component.adoc b/components/camel-file/src/main/docs/file-component.adoc index e695a8a730852..d3a43186b35a5 100644 --- a/components/camel-file/src/main/docs/file-component.adoc +++ b/components/camel-file/src/main/docs/file-component.adoc @@ -114,7 +114,13 @@ with the following path and query parameters: | *startingDirectoryMustExist* (consumer) | Whether the starting directory must exist. Mind that the autoCreate option is default enabled, which means the starting directory is normally auto created if it doesn't exist. You can disable autoCreate and enable this to ensure the starting directory must exist. Will thrown an exception if the directory doesn't exist. | false | boolean | *startingDirectoryMustHave Access* (consumer) | Whether the starting directory has access permissions. Mind that the startingDirectoryMustExist parameter must be set to true in order to verify that the directory exists. Will thrown an exception if the directory doesn't have read and write permissions. | false | boolean | *appendChars* (producer) | Used to append characters (text) after writing files. This can for example be used to add new lines or other separators when writing and appending to existing files. To specify new-line (slash-n or slash-r) or tab (slash-t) characters then escape with an extra slash, eg slash-slash-n | | String -| *fileExist* (producer) | What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. Append - adds content to the existing file. Fail - throws a GenericFileOperationException, indicating that there is already an existing file. Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile 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 Move option will move any existing files, before writing the target file. TryRename is only applicable if tempFileName 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. | Override | GenericFileExist +| *fileExist* (producer) a| What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. + + - Append - adds content to the existing file. + - Fail - throws a GenericFileOperationException, indicating that there is already an existing file. + - Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. + - Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile 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 Move option will move any existing files, before writing the target file. + - TryRename is only applicable if tempFileName 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. | Override | GenericFileExist | *flatten* (producer) | Flatten is used to flatten the file name path to strip any leading paths, so it's just the file name. This allows you to consume recursively into sub-directories, but when you eg write the files to another directory they will be written in a single directory. Setting this to true on the producer enforces that any file name in CamelFileName header will be stripped for any leading paths. | false | boolean | *jailStartingDirectory* (producer) | Used for jailing (restricting) writing files to the starting directory (and sub) only. This is enabled by default to not allow Camel to write files to outside directories (to be more secured out of the box). You can turn this off to allow writing files to directories outside the starting directory, such as parent or root folders. | true | boolean | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | boolean @@ -151,7 +157,18 @@ with the following path and query parameters: | *minDepth* (filter) | The minimum depth to start processing when recursively processing a directory. Using minDepth=1 means the base directory. Using minDepth=2 means the first sub directory. | | int | *move* (filter) | Expression (such as Simple Language) used to dynamically set the filename when moving it after processing. To move files into a .done subdirectory just enter .done. | | String | *exclusiveReadLockStrategy* (lock) | Pluggable read-lock as a org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy implementation. | | GenericFileExclusive ReadLockStrategy -| *readLock* (lock) | 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. This option provides the build in strategies: none - No read lock is in use markerFile - Camel creates a marker file (fileName.camelLock) and then holds a lock on it. This option is not available for the FTP component changed - Changed 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 readLockCheckInterval can be used to set the check frequency. fileLock - is for using java.nio.channels.FileLock. This option is not avail for Windows OS and the FTP component. This approach should be avoided when accessing a remote file system via a mount/share unless that file system supports distributed file locks. rename - rename is for using a try to rename the file as a test if we can get exclusive read-lock. idempotent - (only for file component) idempotent is for using a idempotentRepository as the read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. idempotent-changed - (only for file component) idempotent-changed is for using a idempotentRepository and changed as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. idempotent-rename - (only for file component) idempotent-rename is for using a idempotentRepository and rename as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. Notice: The various read locks is not all suited to work in clustered mode, where concurrent consumers on different nodes is competing for the same files on a shared file system. The markerFile using a close to atomic operation to create the empty marker file, but its not guaranteed to work in a cluster. The fileLock may work better but then the file system need to support distributed file locks, and so on. Using the idempotent read lock can support clustering if the idempotent repository supports clustering, such as Hazelcast Component or Infinispan. | none | String +| *readLock* (lock) a| 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. This option provides the build in strategies: + + - none - No read lock is in use + - markerFile - Camel creates a marker file (fileName.camelLock) and then holds a lock on it. This option is not available for the FTP component + - changed - Changed 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 readLockCheckInterval can be used to set the check frequency. + - fileLock - is for using java.nio.channels.FileLock. This option is not avail for Windows OS and the FTP component. This approach should be avoided when accessing a remote file system via a mount/share unless that file system supports distributed file locks. + - rename - rename is for using a try to rename the file as a test if we can get exclusive read-lock. + - idempotent - (only for file component) idempotent is for using a idempotentRepository as the read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. + - idempotent-changed - (only for file component) idempotent-changed is for using a idempotentRepository and changed as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. + - idempotent-rename - (only for file component) idempotent-rename is for using a idempotentRepository and rename as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. + +Notice: The various read locks is not all suited to work in clustered mode, where concurrent consumers on different nodes is competing for the same files on a shared file system. The markerFile using a close to atomic operation to create the empty marker file, but its not guaranteed to work in a cluster. The fileLock may work better but then the file system need to support distributed file locks, and so on. Using the idempotent read lock can support clustering if the idempotent repository supports clustering, such as Hazelcast Component or Infinispan. | none | String | *readLockCheckInterval* (lock) | 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 changed read lock, you can set a higher interval period to cater for slow writes. The default of 1 sec. may be too fast if the producer is very slow writing the file. Notice: For FTP the default readLockCheckInterval is 5000. The readLockTimeout value must be higher than readLockCheckInterval, but a rule of thumb is to have a timeout that is at least 2 or more times higher than the readLockCheckInterval. This is needed to ensure that amble time is allowed for the read lock process to try to grab the lock before the timeout was hit. | 1000 | long | *readLockDeleteOrphanLock Files* (lock) | Whether or not read lock with marker files should upon startup delete any orphan read lock files, which may have been left on the file system, if Camel was not properly shutdown (such as a JVM crash). If turning this option to false then any orphaned lock file will cause Camel to not attempt to pickup that file, this could also be due another node is concurrently reading files from the same shared directory. | true | boolean | *readLockIdempotentRelease Async* (lock) | Whether the delayed release task should be synchronous or asynchronous. See more details at the readLockIdempotentReleaseDelay option. | false | boolean diff --git a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java index 09ef430064b8d..4b33bee3374c5 100644 --- a/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java +++ b/components/camel-file/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java @@ -837,25 +837,23 @@ public String getReadLock() { /** * 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. - *

- * This option provides the build in strategies: - *

- * Notice: The various read locks is not all suited to work in clustered mode, where concurrent consumers on different nodes is competing + * always determine whether a file is currently being used by another process. The option readLockCheckInterval can be used to set the check frequency.\n + * - fileLock - is for using java.nio.channels.FileLock. This option is not avail for Windows OS and the FTP component. This approach should be avoided when accessing + * a remote file system via a mount/share unless that file system supports distributed file locks.\n + * - rename - rename is for using a try to rename the file as a test if we can get exclusive read-lock.\n + * - idempotent - (only for file component) idempotent is for using a idempotentRepository as the read-lock. + * This allows to use read locks that supports clustering if the idempotent repository implementation supports that.\n + * - idempotent-changed - (only for file component) idempotent-changed is for using a idempotentRepository and changed as the combined read-lock. + * This allows to use read locks that supports clustering if the idempotent repository implementation supports that.\n + * - idempotent-rename - (only for file component) idempotent-rename is for using a idempotentRepository and rename as the combined read-lock. + * This allows to use read locks that supports clustering if the idempotent repository implementation supports that.\n + * \nNotice: The various read locks is not all suited to work in clustered mode, where concurrent consumers on different nodes is competing * for the same files on a shared file system. The markerFile using a close to atomic operation to create the empty marker file, * but its not guaranteed to work in a cluster. The fileLock may work better but then the file system need to support distributed file locks, and so on. * Using the idempotent read lock can support clustering if the idempotent repository supports clustering, such as Hazelcast Component or Infinispan. @@ -1087,17 +1085,16 @@ public GenericFileExist getFileExist() { * What to do if a file already exists with the same name. * * Override, which is the default, replaces the existing file. - * + * The Move option will move any existing files, before writing the target file.\n + * - TryRename is only applicable if tempFileName 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. */ public void setFileExist(GenericFileExist fileExist) { this.fileExist = fileExist; diff --git a/components/camel-ftp/src/main/docs/ftp-component.adoc b/components/camel-ftp/src/main/docs/ftp-component.adoc index 6bde732475fa8..107bb0c409d3b 100644 --- a/components/camel-ftp/src/main/docs/ftp-component.adoc +++ b/components/camel-ftp/src/main/docs/ftp-component.adoc @@ -140,7 +140,7 @@ with the following path and query parameters: | *processStrategy* (consumer) | A pluggable org.apache.camel.component.file.GenericFileProcessStrategy allowing you to implement your own readLock option or similar. Can also be used when special conditions must be met before a file can be consumed, such as a special ready file exists. If this option is set then the readLock option does not apply. | | GenericFileProcess Strategy | *receiveBufferSize* (consumer) | The receive (download) buffer size Used only by FTPClient | 32768 | int | *useList* (consumer) | Whether to allow using LIST command when downloading a file. Default is true. In some use cases you may want to download a specific file and are not allowed to use the LIST command, and therefore you can set this option to false. Notice when using this option, then the specific file to download does not include meta-data information such as file size, timestamp, permissions etc, because those information is only possible to retrieve when LIST command is in use. | true | boolean -| *fileExist* (producer) | What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. Append - adds content to the existing file. Fail - throws a GenericFileOperationException, indicating that there is already an existing file. Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile 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 Move option will move any existing files, before writing the target file. TryRename is only applicable if tempFileName 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. | Override | GenericFileExist +| *fileExist* (producer) | What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. - Append - adds content to the existing file. - Fail - throws a GenericFileOperationException, indicating that there is already an existing file. - Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. - Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile 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 Move option will move any existing files, before writing the target file. - TryRename is only applicable if tempFileName 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. | Override | GenericFileExist | *flatten* (producer) | Flatten is used to flatten the file name path to strip any leading paths, so it's just the file name. This allows you to consume recursively into sub-directories, but when you eg write the files to another directory they will be written in a single directory. Setting this to true on the producer enforces that any file name in CamelFileName header will be stripped for any leading paths. | false | boolean | *jailStartingDirectory* (producer) | Used for jailing (restricting) writing files to the starting directory (and sub) only. This is enabled by default to not allow Camel to write files to outside directories (to be more secured out of the box). You can turn this off to allow writing files to directories outside the starting directory, such as parent or root folders. | true | boolean | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | boolean @@ -188,7 +188,7 @@ with the following path and query parameters: | *minDepth* (filter) | The minimum depth to start processing when recursively processing a directory. Using minDepth=1 means the base directory. Using minDepth=2 means the first sub directory. | | int | *move* (filter) | Expression (such as Simple Language) used to dynamically set the filename when moving it after processing. To move files into a .done subdirectory just enter .done. | | String | *exclusiveReadLockStrategy* (lock) | Pluggable read-lock as a org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy implementation. | | GenericFileExclusive ReadLockStrategy -| *readLock* (lock) | 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. This option provides the build in strategies: none - No read lock is in use markerFile - Camel creates a marker file (fileName.camelLock) and then holds a lock on it. This option is not available for the FTP component changed - Changed 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 readLockCheckInterval can be used to set the check frequency. fileLock - is for using java.nio.channels.FileLock. This option is not avail for Windows OS and the FTP component. This approach should be avoided when accessing a remote file system via a mount/share unless that file system supports distributed file locks. rename - rename is for using a try to rename the file as a test if we can get exclusive read-lock. idempotent - (only for file component) idempotent is for using a idempotentRepository as the read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. idempotent-changed - (only for file component) idempotent-changed is for using a idempotentRepository and changed as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. idempotent-rename - (only for file component) idempotent-rename is for using a idempotentRepository and rename as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. Notice: The various read locks is not all suited to work in clustered mode, where concurrent consumers on different nodes is competing for the same files on a shared file system. The markerFile using a close to atomic operation to create the empty marker file, but its not guaranteed to work in a cluster. The fileLock may work better but then the file system need to support distributed file locks, and so on. Using the idempotent read lock can support clustering if the idempotent repository supports clustering, such as Hazelcast Component or Infinispan. | none | String +| *readLock* (lock) | 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. This option provides the build in strategies: - none - No read lock is in use - markerFile - Camel creates a marker file (fileName.camelLock) and then holds a lock on it. This option is not available for the FTP component - changed - Changed 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 readLockCheckInterval can be used to set the check frequency. - fileLock - is for using java.nio.channels.FileLock. This option is not avail for Windows OS and the FTP component. This approach should be avoided when accessing a remote file system via a mount/share unless that file system supports distributed file locks. - rename - rename is for using a try to rename the file as a test if we can get exclusive read-lock. - idempotent - (only for file component) idempotent is for using a idempotentRepository as the read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. - idempotent-changed - (only for file component) idempotent-changed is for using a idempotentRepository and changed as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. - idempotent-rename - (only for file component) idempotent-rename is for using a idempotentRepository and rename as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. Notice: The various read locks is not all suited to work in clustered mode, where concurrent consumers on different nodes is competing for the same files on a shared file system. The markerFile using a close to atomic operation to create the empty marker file, but its not guaranteed to work in a cluster. The fileLock may work better but then the file system need to support distributed file locks, and so on. Using the idempotent read lock can support clustering if the idempotent repository supports clustering, such as Hazelcast Component or Infinispan. | none | String | *readLockCheckInterval* (lock) | 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 changed read lock, you can set a higher interval period to cater for slow writes. The default of 1 sec. may be too fast if the producer is very slow writing the file. Notice: For FTP the default readLockCheckInterval is 5000. The readLockTimeout value must be higher than readLockCheckInterval, but a rule of thumb is to have a timeout that is at least 2 or more times higher than the readLockCheckInterval. This is needed to ensure that amble time is allowed for the read lock process to try to grab the lock before the timeout was hit. | 1000 | long | *readLockDeleteOrphanLock Files* (lock) | Whether or not read lock with marker files should upon startup delete any orphan read lock files, which may have been left on the file system, if Camel was not properly shutdown (such as a JVM crash). If turning this option to false then any orphaned lock file will cause Camel to not attempt to pickup that file, this could also be due another node is concurrently reading files from the same shared directory. | true | boolean | *readLockLoggingLevel* (lock) | Logging level used when a read lock could not be acquired. By default a DEBUG 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, idempotent, idempotent-changed, idempotent-rename, rename. | DEBUG | LoggingLevel diff --git a/components/camel-ftp/src/main/docs/ftps-component.adoc b/components/camel-ftp/src/main/docs/ftps-component.adoc index d1ab94bb0b496..787d3be842da4 100644 --- a/components/camel-ftp/src/main/docs/ftps-component.adoc +++ b/components/camel-ftp/src/main/docs/ftps-component.adoc @@ -99,7 +99,7 @@ with the following path and query parameters: | *processStrategy* (consumer) | A pluggable org.apache.camel.component.file.GenericFileProcessStrategy allowing you to implement your own readLock option or similar. Can also be used when special conditions must be met before a file can be consumed, such as a special ready file exists. If this option is set then the readLock option does not apply. | | GenericFileProcess Strategy | *receiveBufferSize* (consumer) | The receive (download) buffer size Used only by FTPClient | 32768 | int | *useList* (consumer) | Whether to allow using LIST command when downloading a file. Default is true. In some use cases you may want to download a specific file and are not allowed to use the LIST command, and therefore you can set this option to false. Notice when using this option, then the specific file to download does not include meta-data information such as file size, timestamp, permissions etc, because those information is only possible to retrieve when LIST command is in use. | true | boolean -| *fileExist* (producer) | What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. Append - adds content to the existing file. Fail - throws a GenericFileOperationException, indicating that there is already an existing file. Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile 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 Move option will move any existing files, before writing the target file. TryRename is only applicable if tempFileName 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. | Override | GenericFileExist +| *fileExist* (producer) | What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. - Append - adds content to the existing file. - Fail - throws a GenericFileOperationException, indicating that there is already an existing file. - Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. - Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile 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 Move option will move any existing files, before writing the target file. - TryRename is only applicable if tempFileName 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. | Override | GenericFileExist | *flatten* (producer) | Flatten is used to flatten the file name path to strip any leading paths, so it's just the file name. This allows you to consume recursively into sub-directories, but when you eg write the files to another directory they will be written in a single directory. Setting this to true on the producer enforces that any file name in CamelFileName header will be stripped for any leading paths. | false | boolean | *jailStartingDirectory* (producer) | Used for jailing (restricting) writing files to the starting directory (and sub) only. This is enabled by default to not allow Camel to write files to outside directories (to be more secured out of the box). You can turn this off to allow writing files to directories outside the starting directory, such as parent or root folders. | true | boolean | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | boolean @@ -147,7 +147,7 @@ with the following path and query parameters: | *minDepth* (filter) | The minimum depth to start processing when recursively processing a directory. Using minDepth=1 means the base directory. Using minDepth=2 means the first sub directory. | | int | *move* (filter) | Expression (such as Simple Language) used to dynamically set the filename when moving it after processing. To move files into a .done subdirectory just enter .done. | | String | *exclusiveReadLockStrategy* (lock) | Pluggable read-lock as a org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy implementation. | | GenericFileExclusive ReadLockStrategy -| *readLock* (lock) | 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. This option provides the build in strategies: none - No read lock is in use markerFile - Camel creates a marker file (fileName.camelLock) and then holds a lock on it. This option is not available for the FTP component changed - Changed 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 readLockCheckInterval can be used to set the check frequency. fileLock - is for using java.nio.channels.FileLock. This option is not avail for Windows OS and the FTP component. This approach should be avoided when accessing a remote file system via a mount/share unless that file system supports distributed file locks. rename - rename is for using a try to rename the file as a test if we can get exclusive read-lock. idempotent - (only for file component) idempotent is for using a idempotentRepository as the read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. idempotent-changed - (only for file component) idempotent-changed is for using a idempotentRepository and changed as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. idempotent-rename - (only for file component) idempotent-rename is for using a idempotentRepository and rename as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. Notice: The various read locks is not all suited to work in clustered mode, where concurrent consumers on different nodes is competing for the same files on a shared file system. The markerFile using a close to atomic operation to create the empty marker file, but its not guaranteed to work in a cluster. The fileLock may work better but then the file system need to support distributed file locks, and so on. Using the idempotent read lock can support clustering if the idempotent repository supports clustering, such as Hazelcast Component or Infinispan. | none | String +| *readLock* (lock) | 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. This option provides the build in strategies: - none - No read lock is in use - markerFile - Camel creates a marker file (fileName.camelLock) and then holds a lock on it. This option is not available for the FTP component - changed - Changed 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 readLockCheckInterval can be used to set the check frequency. - fileLock - is for using java.nio.channels.FileLock. This option is not avail for Windows OS and the FTP component. This approach should be avoided when accessing a remote file system via a mount/share unless that file system supports distributed file locks. - rename - rename is for using a try to rename the file as a test if we can get exclusive read-lock. - idempotent - (only for file component) idempotent is for using a idempotentRepository as the read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. - idempotent-changed - (only for file component) idempotent-changed is for using a idempotentRepository and changed as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. - idempotent-rename - (only for file component) idempotent-rename is for using a idempotentRepository and rename as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. Notice: The various read locks is not all suited to work in clustered mode, where concurrent consumers on different nodes is competing for the same files on a shared file system. The markerFile using a close to atomic operation to create the empty marker file, but its not guaranteed to work in a cluster. The fileLock may work better but then the file system need to support distributed file locks, and so on. Using the idempotent read lock can support clustering if the idempotent repository supports clustering, such as Hazelcast Component or Infinispan. | none | String | *readLockCheckInterval* (lock) | 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 changed read lock, you can set a higher interval period to cater for slow writes. The default of 1 sec. may be too fast if the producer is very slow writing the file. Notice: For FTP the default readLockCheckInterval is 5000. The readLockTimeout value must be higher than readLockCheckInterval, but a rule of thumb is to have a timeout that is at least 2 or more times higher than the readLockCheckInterval. This is needed to ensure that amble time is allowed for the read lock process to try to grab the lock before the timeout was hit. | 1000 | long | *readLockDeleteOrphanLock Files* (lock) | Whether or not read lock with marker files should upon startup delete any orphan read lock files, which may have been left on the file system, if Camel was not properly shutdown (such as a JVM crash). If turning this option to false then any orphaned lock file will cause Camel to not attempt to pickup that file, this could also be due another node is concurrently reading files from the same shared directory. | true | boolean | *readLockLoggingLevel* (lock) | Logging level used when a read lock could not be acquired. By default a DEBUG 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, idempotent, idempotent-changed, idempotent-rename, rename. | DEBUG | LoggingLevel diff --git a/components/camel-ftp/src/main/docs/sftp-component.adoc b/components/camel-ftp/src/main/docs/sftp-component.adoc index 4594b342ad197..f948e88700775 100644 --- a/components/camel-ftp/src/main/docs/sftp-component.adoc +++ b/components/camel-ftp/src/main/docs/sftp-component.adoc @@ -91,7 +91,7 @@ with the following path and query parameters: | *pollStrategy* (consumer) | A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel. | | PollingConsumerPoll Strategy | *processStrategy* (consumer) | A pluggable org.apache.camel.component.file.GenericFileProcessStrategy allowing you to implement your own readLock option or similar. Can also be used when special conditions must be met before a file can be consumed, such as a special ready file exists. If this option is set then the readLock option does not apply. | | GenericFileProcess Strategy | *useList* (consumer) | Whether to allow using LIST command when downloading a file. Default is true. In some use cases you may want to download a specific file and are not allowed to use the LIST command, and therefore you can set this option to false. Notice when using this option, then the specific file to download does not include meta-data information such as file size, timestamp, permissions etc, because those information is only possible to retrieve when LIST command is in use. | true | boolean -| *fileExist* (producer) | What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. Append - adds content to the existing file. Fail - throws a GenericFileOperationException, indicating that there is already an existing file. Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile 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 Move option will move any existing files, before writing the target file. TryRename is only applicable if tempFileName 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. | Override | GenericFileExist +| *fileExist* (producer) | What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. - Append - adds content to the existing file. - Fail - throws a GenericFileOperationException, indicating that there is already an existing file. - Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. - Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile 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 Move option will move any existing files, before writing the target file. - TryRename is only applicable if tempFileName 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. | Override | GenericFileExist | *flatten* (producer) | Flatten is used to flatten the file name path to strip any leading paths, so it's just the file name. This allows you to consume recursively into sub-directories, but when you eg write the files to another directory they will be written in a single directory. Setting this to true on the producer enforces that any file name in CamelFileName header will be stripped for any leading paths. | false | boolean | *jailStartingDirectory* (producer) | Used for jailing (restricting) writing files to the starting directory (and sub) only. This is enabled by default to not allow Camel to write files to outside directories (to be more secured out of the box). You can turn this off to allow writing files to directories outside the starting directory, such as parent or root folders. | true | boolean | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | boolean @@ -139,7 +139,7 @@ with the following path and query parameters: | *minDepth* (filter) | The minimum depth to start processing when recursively processing a directory. Using minDepth=1 means the base directory. Using minDepth=2 means the first sub directory. | | int | *move* (filter) | Expression (such as Simple Language) used to dynamically set the filename when moving it after processing. To move files into a .done subdirectory just enter .done. | | String | *exclusiveReadLockStrategy* (lock) | Pluggable read-lock as a org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy implementation. | | GenericFileExclusive ReadLockStrategy -| *readLock* (lock) | 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. This option provides the build in strategies: none - No read lock is in use markerFile - Camel creates a marker file (fileName.camelLock) and then holds a lock on it. This option is not available for the FTP component changed - Changed 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 readLockCheckInterval can be used to set the check frequency. fileLock - is for using java.nio.channels.FileLock. This option is not avail for Windows OS and the FTP component. This approach should be avoided when accessing a remote file system via a mount/share unless that file system supports distributed file locks. rename - rename is for using a try to rename the file as a test if we can get exclusive read-lock. idempotent - (only for file component) idempotent is for using a idempotentRepository as the read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. idempotent-changed - (only for file component) idempotent-changed is for using a idempotentRepository and changed as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. idempotent-rename - (only for file component) idempotent-rename is for using a idempotentRepository and rename as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. Notice: The various read locks is not all suited to work in clustered mode, where concurrent consumers on different nodes is competing for the same files on a shared file system. The markerFile using a close to atomic operation to create the empty marker file, but its not guaranteed to work in a cluster. The fileLock may work better but then the file system need to support distributed file locks, and so on. Using the idempotent read lock can support clustering if the idempotent repository supports clustering, such as Hazelcast Component or Infinispan. | none | String +| *readLock* (lock) | 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. This option provides the build in strategies: - none - No read lock is in use - markerFile - Camel creates a marker file (fileName.camelLock) and then holds a lock on it. This option is not available for the FTP component - changed - Changed 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 readLockCheckInterval can be used to set the check frequency. - fileLock - is for using java.nio.channels.FileLock. This option is not avail for Windows OS and the FTP component. This approach should be avoided when accessing a remote file system via a mount/share unless that file system supports distributed file locks. - rename - rename is for using a try to rename the file as a test if we can get exclusive read-lock. - idempotent - (only for file component) idempotent is for using a idempotentRepository as the read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. - idempotent-changed - (only for file component) idempotent-changed is for using a idempotentRepository and changed as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. - idempotent-rename - (only for file component) idempotent-rename is for using a idempotentRepository and rename as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. Notice: The various read locks is not all suited to work in clustered mode, where concurrent consumers on different nodes is competing for the same files on a shared file system. The markerFile using a close to atomic operation to create the empty marker file, but its not guaranteed to work in a cluster. The fileLock may work better but then the file system need to support distributed file locks, and so on. Using the idempotent read lock can support clustering if the idempotent repository supports clustering, such as Hazelcast Component or Infinispan. | none | String | *readLockCheckInterval* (lock) | 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 changed read lock, you can set a higher interval period to cater for slow writes. The default of 1 sec. may be too fast if the producer is very slow writing the file. Notice: For FTP the default readLockCheckInterval is 5000. The readLockTimeout value must be higher than readLockCheckInterval, but a rule of thumb is to have a timeout that is at least 2 or more times higher than the readLockCheckInterval. This is needed to ensure that amble time is allowed for the read lock process to try to grab the lock before the timeout was hit. | 1000 | long | *readLockDeleteOrphanLock Files* (lock) | Whether or not read lock with marker files should upon startup delete any orphan read lock files, which may have been left on the file system, if Camel was not properly shutdown (such as a JVM crash). If turning this option to false then any orphaned lock file will cause Camel to not attempt to pickup that file, this could also be due another node is concurrently reading files from the same shared directory. | true | boolean | *readLockIdempotentRelease Async* (lock) | Whether the delayed release task should be synchronous or asynchronous. See more details at the readLockIdempotentReleaseDelay option. | false | boolean diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/FileEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/FileEndpointBuilderFactory.java index 0348ef02f72f3..78ec612d7b309 100644 --- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/FileEndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/FileEndpointBuilderFactory.java @@ -803,41 +803,47 @@ default FileEndpointConsumerBuilder exclusiveReadLockStrategy( * 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. This option - * provides the build in strategies: none - No read lock is in use - * markerFile - Camel creates a marker file (fileName.camelLock) and + * provides the build in strategies: + * + * - none - No read lock is in use + * - markerFile - Camel creates a marker file (fileName.camelLock) and * then holds a lock on it. This option is not available for the FTP - * component changed - Changed 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 readLockCheckInterval can be used - * to set the check frequency. fileLock - is for using - * java.nio.channels.FileLock. This option is not avail for Windows OS - * and the FTP component. This approach should be avoided when accessing - * a remote file system via a mount/share unless that file system - * supports distributed file locks. rename - rename is for using a try - * to rename the file as a test if we can get exclusive read-lock. - * idempotent - (only for file component) idempotent is for using a + * component + * - changed - Changed 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 readLockCheckInterval can be used to set + * the check frequency. + * - fileLock - is for using java.nio.channels.FileLock. This option is + * not avail for Windows OS and the FTP component. This approach should + * be avoided when accessing a remote file system via a mount/share + * unless that file system supports distributed file locks. + * - rename - rename is for using a try to rename the file as a test if + * we can get exclusive read-lock. + * - idempotent - (only for file component) idempotent is for using a * idempotentRepository as the read-lock. This allows to use read locks * that supports clustering if the idempotent repository implementation - * supports that. idempotent-changed - (only for file component) - * idempotent-changed is for using a idempotentRepository and changed as - * the combined read-lock. This allows to use read locks that supports - * clustering if the idempotent repository implementation supports that. - * idempotent-rename - (only for file component) idempotent-rename is + * supports that. + * - idempotent-changed - (only for file component) idempotent-changed + * is for using a idempotentRepository and changed as the combined + * read-lock. This allows to use read locks that supports clustering if + * the idempotent repository implementation supports that. + * - idempotent-rename - (only for file component) idempotent-rename is * for using a idempotentRepository and rename as the combined * read-lock. This allows to use read locks that supports clustering if - * the idempotent repository implementation supports that. Notice: The - * various read locks is not all suited to work in clustered mode, where - * concurrent consumers on different nodes is competing for the same - * files on a shared file system. The markerFile using a close to atomic - * operation to create the empty marker file, but its not guaranteed to - * work in a cluster. The fileLock may work better but then the file - * system need to support distributed file locks, and so on. Using the - * idempotent read lock can support clustering if the idempotent - * repository supports clustering, such as Hazelcast Component or - * Infinispan. + * the idempotent repository implementation supports that. + * + * Notice: The various read locks is not all suited to work in clustered + * mode, where concurrent consumers on different nodes is competing for + * the same files on a shared file system. The markerFile using a close + * to atomic operation to create the empty marker file, but its not + * guaranteed to work in a cluster. The fileLock may work better but + * then the file system need to support distributed file locks, and so + * on. Using the idempotent read lock can support clustering if the + * idempotent repository supports clustering, such as Hazelcast + * Component or Infinispan. * * The option is a: java.lang.String type. * @@ -2344,20 +2350,22 @@ default FileEndpointProducerBuilder appendChars(String appendChars) { } /** * What to do if a file already exists with the same name. Override, - * which is the default, replaces the existing file. Append - adds - * content to the existing file. Fail - throws a - * GenericFileOperationException, indicating that there is already an - * existing file. Ignore - silently ignores the problem and does not - * override the existing file, but assumes everything is okay. Move - - * option requires to use the moveExisting option to be configured as - * well. The option eagerDeleteTargetFile 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 Move option will - * move any existing files, before writing the target file. TryRename is - * only applicable if tempFileName 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. + * which is the default, replaces the existing file. + * + * - Append - adds content to the existing file. + * - Fail - throws a GenericFileOperationException, indicating that + * there is already an existing file. + * - Ignore - silently ignores the problem and does not override the + * existing file, but assumes everything is okay. + * - Move - option requires to use the moveExisting option to be + * configured as well. The option eagerDeleteTargetFile 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 Move + * option will move any existing files, before writing the target file. + * - TryRename is only applicable if tempFileName 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. * * The option is a: * org.apache.camel.component.file.GenericFileExist type. @@ -2370,20 +2378,22 @@ default FileEndpointProducerBuilder fileExist(GenericFileExist fileExist) { } /** * What to do if a file already exists with the same name. Override, - * which is the default, replaces the existing file. Append - adds - * content to the existing file. Fail - throws a - * GenericFileOperationException, indicating that there is already an - * existing file. Ignore - silently ignores the problem and does not - * override the existing file, but assumes everything is okay. Move - - * option requires to use the moveExisting option to be configured as - * well. The option eagerDeleteTargetFile 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 Move option will - * move any existing files, before writing the target file. TryRename is - * only applicable if tempFileName 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. + * which is the default, replaces the existing file. + * + * - Append - adds content to the existing file. + * - Fail - throws a GenericFileOperationException, indicating that + * there is already an existing file. + * - Ignore - silently ignores the problem and does not override the + * existing file, but assumes everything is okay. + * - Move - option requires to use the moveExisting option to be + * configured as well. The option eagerDeleteTargetFile 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 Move + * option will move any existing files, before writing the target file. + * - TryRename is only applicable if tempFileName 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. * * The option will be converted to a * org.apache.camel.component.file.GenericFileExist type. diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/FtpEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/FtpEndpointBuilderFactory.java index 636f226288a92..6e8a39fc365fb 100644 --- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/FtpEndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/FtpEndpointBuilderFactory.java @@ -1045,29 +1045,29 @@ default FtpEndpointConsumerBuilder exclusiveReadLockStrategy( * 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. This option - * provides the build in strategies: none - No read lock is in use + * provides the build in strategies: - none - No read lock is in use - * markerFile - Camel creates a marker file (fileName.camelLock) and * then holds a lock on it. This option is not available for the FTP - * component changed - Changed is using file length/modification + * component - changed - Changed 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 readLockCheckInterval can be used - * to set the check frequency. fileLock - is for using + * to set the check frequency. - fileLock - is for using * java.nio.channels.FileLock. This option is not avail for Windows OS * and the FTP component. This approach should be avoided when accessing * a remote file system via a mount/share unless that file system - * supports distributed file locks. rename - rename is for using a try - * to rename the file as a test if we can get exclusive read-lock. + * supports distributed file locks. - rename - rename is for using a try + * to rename the file as a test if we can get exclusive read-lock. - * idempotent - (only for file component) idempotent is for using a * idempotentRepository as the read-lock. This allows to use read locks * that supports clustering if the idempotent repository implementation - * supports that. idempotent-changed - (only for file component) + * supports that. - idempotent-changed - (only for file component) * idempotent-changed is for using a idempotentRepository and changed as * the combined read-lock. This allows to use read locks that supports * clustering if the idempotent repository implementation supports that. - * idempotent-rename - (only for file component) idempotent-rename is + * - idempotent-rename - (only for file component) idempotent-rename is * for using a idempotentRepository and rename as the combined * read-lock. This allows to use read locks that supports clustering if * the idempotent repository implementation supports that. Notice: The @@ -2978,20 +2978,20 @@ default FtpEndpointProducerBuilder transferLoggingVerbose( } /** * What to do if a file already exists with the same name. Override, - * which is the default, replaces the existing file. Append - adds - * content to the existing file. Fail - throws a + * which is the default, replaces the existing file. - Append - adds + * content to the existing file. - Fail - throws a * GenericFileOperationException, indicating that there is already an - * existing file. Ignore - silently ignores the problem and does not - * override the existing file, but assumes everything is okay. Move - + * existing file. - Ignore - silently ignores the problem and does not + * override the existing file, but assumes everything is okay. - Move - * option requires to use the moveExisting option to be configured as * well. The option eagerDeleteTargetFile 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 Move option will - * move any existing files, before writing the target file. TryRename is - * only applicable if tempFileName 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. + * move any existing files, before writing the target file. - TryRename + * is only applicable if tempFileName 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. * * The option is a: * org.apache.camel.component.file.GenericFileExist type. @@ -3004,20 +3004,20 @@ default FtpEndpointProducerBuilder fileExist(GenericFileExist fileExist) { } /** * What to do if a file already exists with the same name. Override, - * which is the default, replaces the existing file. Append - adds - * content to the existing file. Fail - throws a + * which is the default, replaces the existing file. - Append - adds + * content to the existing file. - Fail - throws a * GenericFileOperationException, indicating that there is already an - * existing file. Ignore - silently ignores the problem and does not - * override the existing file, but assumes everything is okay. Move - + * existing file. - Ignore - silently ignores the problem and does not + * override the existing file, but assumes everything is okay. - Move - * option requires to use the moveExisting option to be configured as * well. The option eagerDeleteTargetFile 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 Move option will - * move any existing files, before writing the target file. TryRename is - * only applicable if tempFileName 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. + * move any existing files, before writing the target file. - TryRename + * is only applicable if tempFileName 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. * * The option will be converted to a * org.apache.camel.component.file.GenericFileExist type. diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/FtpsEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/FtpsEndpointBuilderFactory.java index 8bdd34dddfeaa..2d84d90d9b00b 100644 --- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/FtpsEndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/FtpsEndpointBuilderFactory.java @@ -1047,29 +1047,29 @@ default FtpsEndpointConsumerBuilder exclusiveReadLockStrategy( * 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. This option - * provides the build in strategies: none - No read lock is in use + * provides the build in strategies: - none - No read lock is in use - * markerFile - Camel creates a marker file (fileName.camelLock) and * then holds a lock on it. This option is not available for the FTP - * component changed - Changed is using file length/modification + * component - changed - Changed 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 readLockCheckInterval can be used - * to set the check frequency. fileLock - is for using + * to set the check frequency. - fileLock - is for using * java.nio.channels.FileLock. This option is not avail for Windows OS * and the FTP component. This approach should be avoided when accessing * a remote file system via a mount/share unless that file system - * supports distributed file locks. rename - rename is for using a try - * to rename the file as a test if we can get exclusive read-lock. + * supports distributed file locks. - rename - rename is for using a try + * to rename the file as a test if we can get exclusive read-lock. - * idempotent - (only for file component) idempotent is for using a * idempotentRepository as the read-lock. This allows to use read locks * that supports clustering if the idempotent repository implementation - * supports that. idempotent-changed - (only for file component) + * supports that. - idempotent-changed - (only for file component) * idempotent-changed is for using a idempotentRepository and changed as * the combined read-lock. This allows to use read locks that supports * clustering if the idempotent repository implementation supports that. - * idempotent-rename - (only for file component) idempotent-rename is + * - idempotent-rename - (only for file component) idempotent-rename is * for using a idempotentRepository and rename as the combined * read-lock. This allows to use read locks that supports clustering if * the idempotent repository implementation supports that. Notice: The @@ -3168,20 +3168,20 @@ default FtpsEndpointProducerBuilder transferLoggingVerbose( } /** * What to do if a file already exists with the same name. Override, - * which is the default, replaces the existing file. Append - adds - * content to the existing file. Fail - throws a + * which is the default, replaces the existing file. - Append - adds + * content to the existing file. - Fail - throws a * GenericFileOperationException, indicating that there is already an - * existing file. Ignore - silently ignores the problem and does not - * override the existing file, but assumes everything is okay. Move - + * existing file. - Ignore - silently ignores the problem and does not + * override the existing file, but assumes everything is okay. - Move - * option requires to use the moveExisting option to be configured as * well. The option eagerDeleteTargetFile 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 Move option will - * move any existing files, before writing the target file. TryRename is - * only applicable if tempFileName 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. + * move any existing files, before writing the target file. - TryRename + * is only applicable if tempFileName 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. * * The option is a: * org.apache.camel.component.file.GenericFileExist type. @@ -3194,20 +3194,20 @@ default FtpsEndpointProducerBuilder fileExist(GenericFileExist fileExist) { } /** * What to do if a file already exists with the same name. Override, - * which is the default, replaces the existing file. Append - adds - * content to the existing file. Fail - throws a + * which is the default, replaces the existing file. - Append - adds + * content to the existing file. - Fail - throws a * GenericFileOperationException, indicating that there is already an - * existing file. Ignore - silently ignores the problem and does not - * override the existing file, but assumes everything is okay. Move - + * existing file. - Ignore - silently ignores the problem and does not + * override the existing file, but assumes everything is okay. - Move - * option requires to use the moveExisting option to be configured as * well. The option eagerDeleteTargetFile 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 Move option will - * move any existing files, before writing the target file. TryRename is - * only applicable if tempFileName 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. + * move any existing files, before writing the target file. - TryRename + * is only applicable if tempFileName 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. * * The option will be converted to a * org.apache.camel.component.file.GenericFileExist type. diff --git a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/SftpEndpointBuilderFactory.java b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/SftpEndpointBuilderFactory.java index acdc196bf7eac..409356d837bb1 100644 --- a/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/SftpEndpointBuilderFactory.java +++ b/core/camel-endpointdsl/src/main/java/org/apache/camel/builder/endpoint/dsl/SftpEndpointBuilderFactory.java @@ -917,29 +917,29 @@ default SftpEndpointConsumerBuilder exclusiveReadLockStrategy( * 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. This option - * provides the build in strategies: none - No read lock is in use + * provides the build in strategies: - none - No read lock is in use - * markerFile - Camel creates a marker file (fileName.camelLock) and * then holds a lock on it. This option is not available for the FTP - * component changed - Changed is using file length/modification + * component - changed - Changed 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 readLockCheckInterval can be used - * to set the check frequency. fileLock - is for using + * to set the check frequency. - fileLock - is for using * java.nio.channels.FileLock. This option is not avail for Windows OS * and the FTP component. This approach should be avoided when accessing * a remote file system via a mount/share unless that file system - * supports distributed file locks. rename - rename is for using a try - * to rename the file as a test if we can get exclusive read-lock. + * supports distributed file locks. - rename - rename is for using a try + * to rename the file as a test if we can get exclusive read-lock. - * idempotent - (only for file component) idempotent is for using a * idempotentRepository as the read-lock. This allows to use read locks * that supports clustering if the idempotent repository implementation - * supports that. idempotent-changed - (only for file component) + * supports that. - idempotent-changed - (only for file component) * idempotent-changed is for using a idempotentRepository and changed as * the combined read-lock. This allows to use read locks that supports * clustering if the idempotent repository implementation supports that. - * idempotent-rename - (only for file component) idempotent-rename is + * - idempotent-rename - (only for file component) idempotent-rename is * for using a idempotentRepository and rename as the combined * read-lock. This allows to use read locks that supports clustering if * the idempotent repository implementation supports that. Notice: The @@ -3022,20 +3022,20 @@ default SftpEndpointProducerBuilder separator(String separator) { } /** * What to do if a file already exists with the same name. Override, - * which is the default, replaces the existing file. Append - adds - * content to the existing file. Fail - throws a + * which is the default, replaces the existing file. - Append - adds + * content to the existing file. - Fail - throws a * GenericFileOperationException, indicating that there is already an - * existing file. Ignore - silently ignores the problem and does not - * override the existing file, but assumes everything is okay. Move - + * existing file. - Ignore - silently ignores the problem and does not + * override the existing file, but assumes everything is okay. - Move - * option requires to use the moveExisting option to be configured as * well. The option eagerDeleteTargetFile 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 Move option will - * move any existing files, before writing the target file. TryRename is - * only applicable if tempFileName 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. + * move any existing files, before writing the target file. - TryRename + * is only applicable if tempFileName 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. * * The option is a: * org.apache.camel.component.file.GenericFileExist type. @@ -3048,20 +3048,20 @@ default SftpEndpointProducerBuilder fileExist(GenericFileExist fileExist) { } /** * What to do if a file already exists with the same name. Override, - * which is the default, replaces the existing file. Append - adds - * content to the existing file. Fail - throws a + * which is the default, replaces the existing file. - Append - adds + * content to the existing file. - Fail - throws a * GenericFileOperationException, indicating that there is already an - * existing file. Ignore - silently ignores the problem and does not - * override the existing file, but assumes everything is okay. Move - + * existing file. - Ignore - silently ignores the problem and does not + * override the existing file, but assumes everything is okay. - Move - * option requires to use the moveExisting option to be configured as * well. The option eagerDeleteTargetFile 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 Move option will - * move any existing files, before writing the target file. TryRename is - * only applicable if tempFileName 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. + * move any existing files, before writing the target file. - TryRename + * is only applicable if tempFileName 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. * * The option will be converted to a * org.apache.camel.component.file.GenericFileExist type. diff --git a/docs/components/modules/ROOT/pages/file-component.adoc b/docs/components/modules/ROOT/pages/file-component.adoc index 6735a7620cd7b..b3011d5af8d1f 100644 --- a/docs/components/modules/ROOT/pages/file-component.adoc +++ b/docs/components/modules/ROOT/pages/file-component.adoc @@ -115,7 +115,13 @@ with the following path and query parameters: | *startingDirectoryMustExist* (consumer) | Whether the starting directory must exist. Mind that the autoCreate option is default enabled, which means the starting directory is normally auto created if it doesn't exist. You can disable autoCreate and enable this to ensure the starting directory must exist. Will thrown an exception if the directory doesn't exist. | false | boolean | *startingDirectoryMustHave Access* (consumer) | Whether the starting directory has access permissions. Mind that the startingDirectoryMustExist parameter must be set to true in order to verify that the directory exists. Will thrown an exception if the directory doesn't have read and write permissions. | false | boolean | *appendChars* (producer) | Used to append characters (text) after writing files. This can for example be used to add new lines or other separators when writing and appending to existing files. To specify new-line (slash-n or slash-r) or tab (slash-t) characters then escape with an extra slash, eg slash-slash-n | | String -| *fileExist* (producer) | What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. Append - adds content to the existing file. Fail - throws a GenericFileOperationException, indicating that there is already an existing file. Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile 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 Move option will move any existing files, before writing the target file. TryRename is only applicable if tempFileName 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. | Override | GenericFileExist +| *fileExist* (producer) a| What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. + + - Append - adds content to the existing file. + - Fail - throws a GenericFileOperationException, indicating that there is already an existing file. + - Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. + - Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile 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 Move option will move any existing files, before writing the target file. + - TryRename is only applicable if tempFileName 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. | Override | GenericFileExist | *flatten* (producer) | Flatten is used to flatten the file name path to strip any leading paths, so it's just the file name. This allows you to consume recursively into sub-directories, but when you eg write the files to another directory they will be written in a single directory. Setting this to true on the producer enforces that any file name in CamelFileName header will be stripped for any leading paths. | false | boolean | *jailStartingDirectory* (producer) | Used for jailing (restricting) writing files to the starting directory (and sub) only. This is enabled by default to not allow Camel to write files to outside directories (to be more secured out of the box). You can turn this off to allow writing files to directories outside the starting directory, such as parent or root folders. | true | boolean | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | boolean @@ -152,7 +158,18 @@ with the following path and query parameters: | *minDepth* (filter) | The minimum depth to start processing when recursively processing a directory. Using minDepth=1 means the base directory. Using minDepth=2 means the first sub directory. | | int | *move* (filter) | Expression (such as Simple Language) used to dynamically set the filename when moving it after processing. To move files into a .done subdirectory just enter .done. | | String | *exclusiveReadLockStrategy* (lock) | Pluggable read-lock as a org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy implementation. | | GenericFileExclusive ReadLockStrategy -| *readLock* (lock) | 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. This option provides the build in strategies: none - No read lock is in use markerFile - Camel creates a marker file (fileName.camelLock) and then holds a lock on it. This option is not available for the FTP component changed - Changed 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 readLockCheckInterval can be used to set the check frequency. fileLock - is for using java.nio.channels.FileLock. This option is not avail for Windows OS and the FTP component. This approach should be avoided when accessing a remote file system via a mount/share unless that file system supports distributed file locks. rename - rename is for using a try to rename the file as a test if we can get exclusive read-lock. idempotent - (only for file component) idempotent is for using a idempotentRepository as the read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. idempotent-changed - (only for file component) idempotent-changed is for using a idempotentRepository and changed as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. idempotent-rename - (only for file component) idempotent-rename is for using a idempotentRepository and rename as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. Notice: The various read locks is not all suited to work in clustered mode, where concurrent consumers on different nodes is competing for the same files on a shared file system. The markerFile using a close to atomic operation to create the empty marker file, but its not guaranteed to work in a cluster. The fileLock may work better but then the file system need to support distributed file locks, and so on. Using the idempotent read lock can support clustering if the idempotent repository supports clustering, such as Hazelcast Component or Infinispan. | none | String +| *readLock* (lock) a| 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. This option provides the build in strategies: + + - none - No read lock is in use + - markerFile - Camel creates a marker file (fileName.camelLock) and then holds a lock on it. This option is not available for the FTP component + - changed - Changed 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 readLockCheckInterval can be used to set the check frequency. + - fileLock - is for using java.nio.channels.FileLock. This option is not avail for Windows OS and the FTP component. This approach should be avoided when accessing a remote file system via a mount/share unless that file system supports distributed file locks. + - rename - rename is for using a try to rename the file as a test if we can get exclusive read-lock. + - idempotent - (only for file component) idempotent is for using a idempotentRepository as the read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. + - idempotent-changed - (only for file component) idempotent-changed is for using a idempotentRepository and changed as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. + - idempotent-rename - (only for file component) idempotent-rename is for using a idempotentRepository and rename as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. + +Notice: The various read locks is not all suited to work in clustered mode, where concurrent consumers on different nodes is competing for the same files on a shared file system. The markerFile using a close to atomic operation to create the empty marker file, but its not guaranteed to work in a cluster. The fileLock may work better but then the file system need to support distributed file locks, and so on. Using the idempotent read lock can support clustering if the idempotent repository supports clustering, such as Hazelcast Component or Infinispan. | none | String | *readLockCheckInterval* (lock) | 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 changed read lock, you can set a higher interval period to cater for slow writes. The default of 1 sec. may be too fast if the producer is very slow writing the file. Notice: For FTP the default readLockCheckInterval is 5000. The readLockTimeout value must be higher than readLockCheckInterval, but a rule of thumb is to have a timeout that is at least 2 or more times higher than the readLockCheckInterval. This is needed to ensure that amble time is allowed for the read lock process to try to grab the lock before the timeout was hit. | 1000 | long | *readLockDeleteOrphanLock Files* (lock) | Whether or not read lock with marker files should upon startup delete any orphan read lock files, which may have been left on the file system, if Camel was not properly shutdown (such as a JVM crash). If turning this option to false then any orphaned lock file will cause Camel to not attempt to pickup that file, this could also be due another node is concurrently reading files from the same shared directory. | true | boolean | *readLockIdempotentRelease Async* (lock) | Whether the delayed release task should be synchronous or asynchronous. See more details at the readLockIdempotentReleaseDelay option. | false | boolean diff --git a/docs/components/modules/ROOT/pages/ftp-component.adoc b/docs/components/modules/ROOT/pages/ftp-component.adoc index 558d27772f860..3e481e34a97d7 100644 --- a/docs/components/modules/ROOT/pages/ftp-component.adoc +++ b/docs/components/modules/ROOT/pages/ftp-component.adoc @@ -141,7 +141,7 @@ with the following path and query parameters: | *processStrategy* (consumer) | A pluggable org.apache.camel.component.file.GenericFileProcessStrategy allowing you to implement your own readLock option or similar. Can also be used when special conditions must be met before a file can be consumed, such as a special ready file exists. If this option is set then the readLock option does not apply. | | GenericFileProcess Strategy | *receiveBufferSize* (consumer) | The receive (download) buffer size Used only by FTPClient | 32768 | int | *useList* (consumer) | Whether to allow using LIST command when downloading a file. Default is true. In some use cases you may want to download a specific file and are not allowed to use the LIST command, and therefore you can set this option to false. Notice when using this option, then the specific file to download does not include meta-data information such as file size, timestamp, permissions etc, because those information is only possible to retrieve when LIST command is in use. | true | boolean -| *fileExist* (producer) | What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. Append - adds content to the existing file. Fail - throws a GenericFileOperationException, indicating that there is already an existing file. Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile 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 Move option will move any existing files, before writing the target file. TryRename is only applicable if tempFileName 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. | Override | GenericFileExist +| *fileExist* (producer) | What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. - Append - adds content to the existing file. - Fail - throws a GenericFileOperationException, indicating that there is already an existing file. - Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. - Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile 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 Move option will move any existing files, before writing the target file. - TryRename is only applicable if tempFileName 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. | Override | GenericFileExist | *flatten* (producer) | Flatten is used to flatten the file name path to strip any leading paths, so it's just the file name. This allows you to consume recursively into sub-directories, but when you eg write the files to another directory they will be written in a single directory. Setting this to true on the producer enforces that any file name in CamelFileName header will be stripped for any leading paths. | false | boolean | *jailStartingDirectory* (producer) | Used for jailing (restricting) writing files to the starting directory (and sub) only. This is enabled by default to not allow Camel to write files to outside directories (to be more secured out of the box). You can turn this off to allow writing files to directories outside the starting directory, such as parent or root folders. | true | boolean | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | boolean @@ -189,7 +189,7 @@ with the following path and query parameters: | *minDepth* (filter) | The minimum depth to start processing when recursively processing a directory. Using minDepth=1 means the base directory. Using minDepth=2 means the first sub directory. | | int | *move* (filter) | Expression (such as Simple Language) used to dynamically set the filename when moving it after processing. To move files into a .done subdirectory just enter .done. | | String | *exclusiveReadLockStrategy* (lock) | Pluggable read-lock as a org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy implementation. | | GenericFileExclusive ReadLockStrategy -| *readLock* (lock) | 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. This option provides the build in strategies: none - No read lock is in use markerFile - Camel creates a marker file (fileName.camelLock) and then holds a lock on it. This option is not available for the FTP component changed - Changed 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 readLockCheckInterval can be used to set the check frequency. fileLock - is for using java.nio.channels.FileLock. This option is not avail for Windows OS and the FTP component. This approach should be avoided when accessing a remote file system via a mount/share unless that file system supports distributed file locks. rename - rename is for using a try to rename the file as a test if we can get exclusive read-lock. idempotent - (only for file component) idempotent is for using a idempotentRepository as the read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. idempotent-changed - (only for file component) idempotent-changed is for using a idempotentRepository and changed as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. idempotent-rename - (only for file component) idempotent-rename is for using a idempotentRepository and rename as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. Notice: The various read locks is not all suited to work in clustered mode, where concurrent consumers on different nodes is competing for the same files on a shared file system. The markerFile using a close to atomic operation to create the empty marker file, but its not guaranteed to work in a cluster. The fileLock may work better but then the file system need to support distributed file locks, and so on. Using the idempotent read lock can support clustering if the idempotent repository supports clustering, such as Hazelcast Component or Infinispan. | none | String +| *readLock* (lock) | 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. This option provides the build in strategies: - none - No read lock is in use - markerFile - Camel creates a marker file (fileName.camelLock) and then holds a lock on it. This option is not available for the FTP component - changed - Changed 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 readLockCheckInterval can be used to set the check frequency. - fileLock - is for using java.nio.channels.FileLock. This option is not avail for Windows OS and the FTP component. This approach should be avoided when accessing a remote file system via a mount/share unless that file system supports distributed file locks. - rename - rename is for using a try to rename the file as a test if we can get exclusive read-lock. - idempotent - (only for file component) idempotent is for using a idempotentRepository as the read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. - idempotent-changed - (only for file component) idempotent-changed is for using a idempotentRepository and changed as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. - idempotent-rename - (only for file component) idempotent-rename is for using a idempotentRepository and rename as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. Notice: The various read locks is not all suited to work in clustered mode, where concurrent consumers on different nodes is competing for the same files on a shared file system. The markerFile using a close to atomic operation to create the empty marker file, but its not guaranteed to work in a cluster. The fileLock may work better but then the file system need to support distributed file locks, and so on. Using the idempotent read lock can support clustering if the idempotent repository supports clustering, such as Hazelcast Component or Infinispan. | none | String | *readLockCheckInterval* (lock) | 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 changed read lock, you can set a higher interval period to cater for slow writes. The default of 1 sec. may be too fast if the producer is very slow writing the file. Notice: For FTP the default readLockCheckInterval is 5000. The readLockTimeout value must be higher than readLockCheckInterval, but a rule of thumb is to have a timeout that is at least 2 or more times higher than the readLockCheckInterval. This is needed to ensure that amble time is allowed for the read lock process to try to grab the lock before the timeout was hit. | 1000 | long | *readLockDeleteOrphanLock Files* (lock) | Whether or not read lock with marker files should upon startup delete any orphan read lock files, which may have been left on the file system, if Camel was not properly shutdown (such as a JVM crash). If turning this option to false then any orphaned lock file will cause Camel to not attempt to pickup that file, this could also be due another node is concurrently reading files from the same shared directory. | true | boolean | *readLockLoggingLevel* (lock) | Logging level used when a read lock could not be acquired. By default a DEBUG 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, idempotent, idempotent-changed, idempotent-rename, rename. | DEBUG | LoggingLevel diff --git a/docs/components/modules/ROOT/pages/ftps-component.adoc b/docs/components/modules/ROOT/pages/ftps-component.adoc index 39091d11af3d4..3f8bb4802278c 100644 --- a/docs/components/modules/ROOT/pages/ftps-component.adoc +++ b/docs/components/modules/ROOT/pages/ftps-component.adoc @@ -100,7 +100,7 @@ with the following path and query parameters: | *processStrategy* (consumer) | A pluggable org.apache.camel.component.file.GenericFileProcessStrategy allowing you to implement your own readLock option or similar. Can also be used when special conditions must be met before a file can be consumed, such as a special ready file exists. If this option is set then the readLock option does not apply. | | GenericFileProcess Strategy | *receiveBufferSize* (consumer) | The receive (download) buffer size Used only by FTPClient | 32768 | int | *useList* (consumer) | Whether to allow using LIST command when downloading a file. Default is true. In some use cases you may want to download a specific file and are not allowed to use the LIST command, and therefore you can set this option to false. Notice when using this option, then the specific file to download does not include meta-data information such as file size, timestamp, permissions etc, because those information is only possible to retrieve when LIST command is in use. | true | boolean -| *fileExist* (producer) | What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. Append - adds content to the existing file. Fail - throws a GenericFileOperationException, indicating that there is already an existing file. Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile 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 Move option will move any existing files, before writing the target file. TryRename is only applicable if tempFileName 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. | Override | GenericFileExist +| *fileExist* (producer) | What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. - Append - adds content to the existing file. - Fail - throws a GenericFileOperationException, indicating that there is already an existing file. - Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. - Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile 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 Move option will move any existing files, before writing the target file. - TryRename is only applicable if tempFileName 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. | Override | GenericFileExist | *flatten* (producer) | Flatten is used to flatten the file name path to strip any leading paths, so it's just the file name. This allows you to consume recursively into sub-directories, but when you eg write the files to another directory they will be written in a single directory. Setting this to true on the producer enforces that any file name in CamelFileName header will be stripped for any leading paths. | false | boolean | *jailStartingDirectory* (producer) | Used for jailing (restricting) writing files to the starting directory (and sub) only. This is enabled by default to not allow Camel to write files to outside directories (to be more secured out of the box). You can turn this off to allow writing files to directories outside the starting directory, such as parent or root folders. | true | boolean | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | boolean @@ -148,7 +148,7 @@ with the following path and query parameters: | *minDepth* (filter) | The minimum depth to start processing when recursively processing a directory. Using minDepth=1 means the base directory. Using minDepth=2 means the first sub directory. | | int | *move* (filter) | Expression (such as Simple Language) used to dynamically set the filename when moving it after processing. To move files into a .done subdirectory just enter .done. | | String | *exclusiveReadLockStrategy* (lock) | Pluggable read-lock as a org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy implementation. | | GenericFileExclusive ReadLockStrategy -| *readLock* (lock) | 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. This option provides the build in strategies: none - No read lock is in use markerFile - Camel creates a marker file (fileName.camelLock) and then holds a lock on it. This option is not available for the FTP component changed - Changed 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 readLockCheckInterval can be used to set the check frequency. fileLock - is for using java.nio.channels.FileLock. This option is not avail for Windows OS and the FTP component. This approach should be avoided when accessing a remote file system via a mount/share unless that file system supports distributed file locks. rename - rename is for using a try to rename the file as a test if we can get exclusive read-lock. idempotent - (only for file component) idempotent is for using a idempotentRepository as the read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. idempotent-changed - (only for file component) idempotent-changed is for using a idempotentRepository and changed as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. idempotent-rename - (only for file component) idempotent-rename is for using a idempotentRepository and rename as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. Notice: The various read locks is not all suited to work in clustered mode, where concurrent consumers on different nodes is competing for the same files on a shared file system. The markerFile using a close to atomic operation to create the empty marker file, but its not guaranteed to work in a cluster. The fileLock may work better but then the file system need to support distributed file locks, and so on. Using the idempotent read lock can support clustering if the idempotent repository supports clustering, such as Hazelcast Component or Infinispan. | none | String +| *readLock* (lock) | 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. This option provides the build in strategies: - none - No read lock is in use - markerFile - Camel creates a marker file (fileName.camelLock) and then holds a lock on it. This option is not available for the FTP component - changed - Changed 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 readLockCheckInterval can be used to set the check frequency. - fileLock - is for using java.nio.channels.FileLock. This option is not avail for Windows OS and the FTP component. This approach should be avoided when accessing a remote file system via a mount/share unless that file system supports distributed file locks. - rename - rename is for using a try to rename the file as a test if we can get exclusive read-lock. - idempotent - (only for file component) idempotent is for using a idempotentRepository as the read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. - idempotent-changed - (only for file component) idempotent-changed is for using a idempotentRepository and changed as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. - idempotent-rename - (only for file component) idempotent-rename is for using a idempotentRepository and rename as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. Notice: The various read locks is not all suited to work in clustered mode, where concurrent consumers on different nodes is competing for the same files on a shared file system. The markerFile using a close to atomic operation to create the empty marker file, but its not guaranteed to work in a cluster. The fileLock may work better but then the file system need to support distributed file locks, and so on. Using the idempotent read lock can support clustering if the idempotent repository supports clustering, such as Hazelcast Component or Infinispan. | none | String | *readLockCheckInterval* (lock) | 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 changed read lock, you can set a higher interval period to cater for slow writes. The default of 1 sec. may be too fast if the producer is very slow writing the file. Notice: For FTP the default readLockCheckInterval is 5000. The readLockTimeout value must be higher than readLockCheckInterval, but a rule of thumb is to have a timeout that is at least 2 or more times higher than the readLockCheckInterval. This is needed to ensure that amble time is allowed for the read lock process to try to grab the lock before the timeout was hit. | 1000 | long | *readLockDeleteOrphanLock Files* (lock) | Whether or not read lock with marker files should upon startup delete any orphan read lock files, which may have been left on the file system, if Camel was not properly shutdown (such as a JVM crash). If turning this option to false then any orphaned lock file will cause Camel to not attempt to pickup that file, this could also be due another node is concurrently reading files from the same shared directory. | true | boolean | *readLockLoggingLevel* (lock) | Logging level used when a read lock could not be acquired. By default a DEBUG 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, idempotent, idempotent-changed, idempotent-rename, rename. | DEBUG | LoggingLevel diff --git a/docs/components/modules/ROOT/pages/sftp-component.adoc b/docs/components/modules/ROOT/pages/sftp-component.adoc index ea487c5c8f046..e03ad70845233 100644 --- a/docs/components/modules/ROOT/pages/sftp-component.adoc +++ b/docs/components/modules/ROOT/pages/sftp-component.adoc @@ -92,7 +92,7 @@ with the following path and query parameters: | *pollStrategy* (consumer) | A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel. | | PollingConsumerPoll Strategy | *processStrategy* (consumer) | A pluggable org.apache.camel.component.file.GenericFileProcessStrategy allowing you to implement your own readLock option or similar. Can also be used when special conditions must be met before a file can be consumed, such as a special ready file exists. If this option is set then the readLock option does not apply. | | GenericFileProcess Strategy | *useList* (consumer) | Whether to allow using LIST command when downloading a file. Default is true. In some use cases you may want to download a specific file and are not allowed to use the LIST command, and therefore you can set this option to false. Notice when using this option, then the specific file to download does not include meta-data information such as file size, timestamp, permissions etc, because those information is only possible to retrieve when LIST command is in use. | true | boolean -| *fileExist* (producer) | What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. Append - adds content to the existing file. Fail - throws a GenericFileOperationException, indicating that there is already an existing file. Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile 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 Move option will move any existing files, before writing the target file. TryRename is only applicable if tempFileName 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. | Override | GenericFileExist +| *fileExist* (producer) | What to do if a file already exists with the same name. Override, which is the default, replaces the existing file. - Append - adds content to the existing file. - Fail - throws a GenericFileOperationException, indicating that there is already an existing file. - Ignore - silently ignores the problem and does not override the existing file, but assumes everything is okay. - Move - option requires to use the moveExisting option to be configured as well. The option eagerDeleteTargetFile 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 Move option will move any existing files, before writing the target file. - TryRename is only applicable if tempFileName 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. | Override | GenericFileExist | *flatten* (producer) | Flatten is used to flatten the file name path to strip any leading paths, so it's just the file name. This allows you to consume recursively into sub-directories, but when you eg write the files to another directory they will be written in a single directory. Setting this to true on the producer enforces that any file name in CamelFileName header will be stripped for any leading paths. | false | boolean | *jailStartingDirectory* (producer) | Used for jailing (restricting) writing files to the starting directory (and sub) only. This is enabled by default to not allow Camel to write files to outside directories (to be more secured out of the box). You can turn this off to allow writing files to directories outside the starting directory, such as parent or root folders. | true | boolean | *lazyStartProducer* (producer) | Whether the producer should be started lazy (on the first message). By starting lazy you can use this to allow CamelContext and routes to startup in situations where a producer may otherwise fail during starting and cause the route to fail being started. By deferring this startup to be lazy then the startup failure can be handled during routing messages via Camel's routing error handlers. Beware that when the first message is processed then creating and starting the producer may take a little time and prolong the total processing time of the processing. | false | boolean @@ -140,7 +140,7 @@ with the following path and query parameters: | *minDepth* (filter) | The minimum depth to start processing when recursively processing a directory. Using minDepth=1 means the base directory. Using minDepth=2 means the first sub directory. | | int | *move* (filter) | Expression (such as Simple Language) used to dynamically set the filename when moving it after processing. To move files into a .done subdirectory just enter .done. | | String | *exclusiveReadLockStrategy* (lock) | Pluggable read-lock as a org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy implementation. | | GenericFileExclusive ReadLockStrategy -| *readLock* (lock) | 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. This option provides the build in strategies: none - No read lock is in use markerFile - Camel creates a marker file (fileName.camelLock) and then holds a lock on it. This option is not available for the FTP component changed - Changed 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 readLockCheckInterval can be used to set the check frequency. fileLock - is for using java.nio.channels.FileLock. This option is not avail for Windows OS and the FTP component. This approach should be avoided when accessing a remote file system via a mount/share unless that file system supports distributed file locks. rename - rename is for using a try to rename the file as a test if we can get exclusive read-lock. idempotent - (only for file component) idempotent is for using a idempotentRepository as the read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. idempotent-changed - (only for file component) idempotent-changed is for using a idempotentRepository and changed as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. idempotent-rename - (only for file component) idempotent-rename is for using a idempotentRepository and rename as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. Notice: The various read locks is not all suited to work in clustered mode, where concurrent consumers on different nodes is competing for the same files on a shared file system. The markerFile using a close to atomic operation to create the empty marker file, but its not guaranteed to work in a cluster. The fileLock may work better but then the file system need to support distributed file locks, and so on. Using the idempotent read lock can support clustering if the idempotent repository supports clustering, such as Hazelcast Component or Infinispan. | none | String +| *readLock* (lock) | 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. This option provides the build in strategies: - none - No read lock is in use - markerFile - Camel creates a marker file (fileName.camelLock) and then holds a lock on it. This option is not available for the FTP component - changed - Changed 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 readLockCheckInterval can be used to set the check frequency. - fileLock - is for using java.nio.channels.FileLock. This option is not avail for Windows OS and the FTP component. This approach should be avoided when accessing a remote file system via a mount/share unless that file system supports distributed file locks. - rename - rename is for using a try to rename the file as a test if we can get exclusive read-lock. - idempotent - (only for file component) idempotent is for using a idempotentRepository as the read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. - idempotent-changed - (only for file component) idempotent-changed is for using a idempotentRepository and changed as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. - idempotent-rename - (only for file component) idempotent-rename is for using a idempotentRepository and rename as the combined read-lock. This allows to use read locks that supports clustering if the idempotent repository implementation supports that. Notice: The various read locks is not all suited to work in clustered mode, where concurrent consumers on different nodes is competing for the same files on a shared file system. The markerFile using a close to atomic operation to create the empty marker file, but its not guaranteed to work in a cluster. The fileLock may work better but then the file system need to support distributed file locks, and so on. Using the idempotent read lock can support clustering if the idempotent repository supports clustering, such as Hazelcast Component or Infinispan. | none | String | *readLockCheckInterval* (lock) | 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 changed read lock, you can set a higher interval period to cater for slow writes. The default of 1 sec. may be too fast if the producer is very slow writing the file. Notice: For FTP the default readLockCheckInterval is 5000. The readLockTimeout value must be higher than readLockCheckInterval, but a rule of thumb is to have a timeout that is at least 2 or more times higher than the readLockCheckInterval. This is needed to ensure that amble time is allowed for the read lock process to try to grab the lock before the timeout was hit. | 1000 | long | *readLockDeleteOrphanLock Files* (lock) | Whether or not read lock with marker files should upon startup delete any orphan read lock files, which may have been left on the file system, if Camel was not properly shutdown (such as a JVM crash). If turning this option to false then any orphaned lock file will cause Camel to not attempt to pickup that file, this could also be due another node is concurrently reading files from the same shared directory. | true | boolean | *readLockIdempotentRelease Async* (lock) | Whether the delayed release task should be synchronous or asynchronous. See more details at the readLockIdempotentReleaseDelay option. | false | boolean diff --git a/tooling/maven/camel-package-maven-plugin/src/main/resources/component-options.mvel b/tooling/maven/camel-package-maven-plugin/src/main/resources/component-options.mvel index ac169769203a8..27f0ef672cf6e 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/resources/component-options.mvel +++ b/tooling/maven/camel-package-maven-plugin/src/main/resources/component-options.mvel @@ -6,8 +6,8 @@ The @{title} component supports @{componentOptions.size()} options, which are li @if{!componentOptions.isEmpty()} [width="100%",cols="2,5,^1,2",options="header"] -|=== +|===@comment{ Render table cells. If description contains newline, prefix cell with `a`, so the content is rendered with formatting. } | Name | Description | Default | Type -@foreach{row : componentOptions}| *@{row.getShortName(25)}* (@{row.shortGroup}) | @{util.escape(row.description)} | @{row.getShortDefaultValue(20)} | @{row.getShortJavaType(25)} +@foreach{row : componentOptions}| *@{row.getShortName(25)}* (@{row.shortGroup}) @{row.description.?contains("\n") ? "a" : ""}| @{util.escape(row.description)} | @{row.getShortDefaultValue(20)} | @{row.getShortJavaType(25)} @end{}|=== @end{} diff --git a/tooling/maven/camel-package-maven-plugin/src/main/resources/dataformat-options.mvel b/tooling/maven/camel-package-maven-plugin/src/main/resources/dataformat-options.mvel index 5942392d38bff..4565ea5b08ab5 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/resources/dataformat-options.mvel +++ b/tooling/maven/camel-package-maven-plugin/src/main/resources/dataformat-options.mvel @@ -6,8 +6,8 @@ The @{title} dataformat supports @{dataFormatOptions.size()} options, which are @if{!dataFormatOptions.isEmpty()} [width="100%",cols="2s,1m,1m,6",options="header"] -|=== +|===@comment{ Render table cells. If description contains newline, prefix cell with `a`, so the content is rendered with formatting. } | Name | Default | Java Type | Description -@foreach{row : dataFormatOptions}| @{row.name} | @{row.defaultValue} | @{row.shortJavaType} | @{util.escape(row.description)} +@foreach{row : dataFormatOptions}| @{row.name} | @{row.defaultValue} | @{row.shortJavaType} @{row.description.?contains("\n") ? "a" : ""}| @{util.escape(row.description)} @end{}|=== @end{} \ No newline at end of file diff --git a/tooling/maven/camel-package-maven-plugin/src/main/resources/eip-options.mvel b/tooling/maven/camel-package-maven-plugin/src/main/resources/eip-options.mvel index a11511a02a394..fdd022c821d0d 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/resources/eip-options.mvel +++ b/tooling/maven/camel-package-maven-plugin/src/main/resources/eip-options.mvel @@ -4,8 +4,8 @@ The @{title} EIP has no options. The @{title} EIP supports @{eipOptions.size()} options which are listed below: [width="100%",cols="2,5,^1,2",options="header"] -|=== +|===@comment{ Render table cells. If description contains newline, prefix cell with `a`, so the content is rendered with formatting. } | Name | Description | Default | Type -@foreach{row : eipOptions}| *@{row.getShortName(30)}* | @{util.escape(row.description)} | @{row.getShortDefaultValue(20)} | @{row.getShortJavaType(25)} +@foreach{row : eipOptions}| *@{row.getShortName(30)}* @{row.description.?contains("\n") ? "a" : ""}| @{util.escape(row.description)} | @{row.getShortDefaultValue(20)} | @{row.getShortJavaType(25)} @end{}|=== @end{} \ No newline at end of file diff --git a/tooling/maven/camel-package-maven-plugin/src/main/resources/endpoint-options.mvel b/tooling/maven/camel-package-maven-plugin/src/main/resources/endpoint-options.mvel index 52be0286e2e99..3387047fc64bc 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/resources/endpoint-options.mvel +++ b/tooling/maven/camel-package-maven-plugin/src/main/resources/endpoint-options.mvel @@ -12,9 +12,9 @@ with the following path and query parameters: The @{title} endpoint has no path parameters. @else{} [width="100%",cols="2,5,^1,2",options="header"] -|=== +|===@comment{ Render table cells. If description contains newline, prefix cell with `a`, so the content is rendered with formatting. } | Name | Description | Default | Type -@foreach{row : endpointPathOptions}| *@{row.getShortName(30)}* | @{util.escape(row.description)} | @{row.getShortDefaultValue(20)} | @{row.getShortJavaType(25)} +@foreach{row : endpointPathOptions}| *@{row.getShortName(30)}* @{row.description.?contains("\n") ? "a" : ""}| @{util.escape(row.description)} | @{row.getShortDefaultValue(20)} | @{row.getShortJavaType(25)} @end{}|=== @end{} @@ -24,8 +24,8 @@ The @{title} endpoint has no path parameters. The @{title} endpoint has no query parameters. @else{} [width="100%",cols="2,5,^1,2",options="header"] -|=== +|===@comment{ Render table cells. If description contains newline, prefix cell with `a`, so the content is rendered with formatting. } | Name | Description | Default | Type -@foreach{row : endpointOptions}| *@{row.getShortName(30)}* (@{row.shortGroup}) | @{util.escape(row.description)} | @{row.getShortDefaultValue(20)} | @{row.getShortJavaType(25)} +@foreach{row : endpointOptions}| *@{row.getShortName(30)}* (@{row.shortGroup}) @{row.description.?contains("\n") ? "a" : ""}| @{util.escape(row.description)} | @{row.getShortDefaultValue(20)} | @{row.getShortJavaType(25)} @end{}|=== @end{} diff --git a/tooling/maven/camel-package-maven-plugin/src/main/resources/language-options.mvel b/tooling/maven/camel-package-maven-plugin/src/main/resources/language-options.mvel index 498d3381b0b32..69332922537ad 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/resources/language-options.mvel +++ b/tooling/maven/camel-package-maven-plugin/src/main/resources/language-options.mvel @@ -6,8 +6,8 @@ The @{title} language supports @{languageOptions.size()} options, which are list @if{!languageOptions.isEmpty()} [width="100%",cols="2,1m,1m,6",options="header"] -|=== +|===@comment{ Render table cells. If description contains newline, prefix cell with `a`, so the content is rendered with formatting. } | Name | Default | Java Type | Description -@foreach{row : languageOptions}| @{row.name} | @{row.defaultValue} | @{row.shortJavaType} | @{util.escape(row.description)} +@foreach{row : languageOptions}| @{row.name} | @{row.defaultValue} | @{row.shortJavaType} @{row.description.?contains("\n") ? "a" : ""}| @{util.escape(row.description)} @end{}|=== @end{} \ No newline at end of file