diff --git a/components-starter/camel-file-cluster-service-starter/src/main/docs/file-cluster-service.json b/components-starter/camel-file-cluster-service-starter/src/main/docs/file-cluster-service.json index 375e915b00f8..cb127f57ffc3 100644 --- a/components-starter/camel-file-cluster-service-starter/src/main/docs/file-cluster-service.json +++ b/components-starter/camel-file-cluster-service-starter/src/main/docs/file-cluster-service.json @@ -10,13 +10,13 @@ { "name": "camel.cluster.file.acquire-lock-delay", "type": "java.lang.String", - "description": "The time to wait before starting to try to acquire lock.", + "description": "The time to wait before starting to try to acquire the cluster lock. Note that if FileLockClusterService determines no cluster members are running or cannot reliably determine the cluster state, the initial delay is computed from the acquireLockInterval.", "sourceType": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration" }, { "name": "camel.cluster.file.acquire-lock-interval", "type": "java.lang.String", - "description": "The time to wait between attempts to try to acquire lock.", + "description": "The time to wait between attempts to try to acquire the cluster lock evaluated using wall-clock time. All cluster members must use the same value so leadership checks and leader liveness detection remain consistent.", "sourceType": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration" }, { @@ -25,6 +25,18 @@ "description": "Custom service attributes.", "sourceType": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration" }, + { + "name": "camel.cluster.file.cluster-data-task-max-attempts", + "type": "java.lang.Integer", + "description": "The number of times a cluster data task will run, counting both the first execution and subsequent retries in case of failure or timeout.

This can be useful when the cluster data root is on network based file storage, where I\/O operations may occasionally block for long or unpredictable periods.", + "sourceType": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration" + }, + { + "name": "camel.cluster.file.cluster-data-task-timeout", + "type": "java.lang.Long", + "description": "The timeout for a cluster data task (reading or writing cluster data).

Timeouts are useful when the cluster data root is on network storage, where I\/O operations may occasionally block for long or unpredictable periods.", + "sourceType": "org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration" + }, { "name": "camel.cluster.file.enabled", "type": "java.lang.Boolean", diff --git a/components-starter/camel-file-cluster-service-starter/src/main/java/org/apache/camel/component/file/springboot/cluster/FileLockClusterServiceAutoConfiguration.java b/components-starter/camel-file-cluster-service-starter/src/main/java/org/apache/camel/component/file/springboot/cluster/FileLockClusterServiceAutoConfiguration.java index e725ac8f7a7f..c7edcb008d29 100644 --- a/components-starter/camel-file-cluster-service-starter/src/main/java/org/apache/camel/component/file/springboot/cluster/FileLockClusterServiceAutoConfiguration.java +++ b/components-starter/camel-file-cluster-service-starter/src/main/java/org/apache/camel/component/file/springboot/cluster/FileLockClusterServiceAutoConfiguration.java @@ -55,6 +55,8 @@ public CamelClusterService fileClusterService() throws Exception { Optional.ofNullable(configuration.getAcquireLockInterval()).map(TimePatternConverter::toMilliSeconds) .ifPresent(v -> service.setAcquireLockInterval(v, TimeUnit.MILLISECONDS)); Optional.ofNullable(configuration.getHeartbeatTimeoutMultiplier()).ifPresent(service::setHeartbeatTimeoutMultiplier); + Optional.ofNullable(configuration.getClusterDataTaskMaxAttempts()).ifPresent(service::setClusterDataTaskMaxAttempts); + Optional.ofNullable(configuration.getClusterDataTaskTimeout()).ifPresent(service::setClusterDataTaskTimeout); return service; } diff --git a/components-starter/camel-file-cluster-service-starter/src/main/java/org/apache/camel/component/file/springboot/cluster/FileLockClusterServiceConfiguration.java b/components-starter/camel-file-cluster-service-starter/src/main/java/org/apache/camel/component/file/springboot/cluster/FileLockClusterServiceConfiguration.java index c87c6a9aaffe..39b5b5ad71e1 100644 --- a/components-starter/camel-file-cluster-service-starter/src/main/java/org/apache/camel/component/file/springboot/cluster/FileLockClusterServiceConfiguration.java +++ b/components-starter/camel-file-cluster-service-starter/src/main/java/org/apache/camel/component/file/springboot/cluster/FileLockClusterServiceConfiguration.java @@ -38,12 +38,15 @@ public class FileLockClusterServiceConfiguration { private String root; /** - * The time to wait before starting to try to acquire lock. + * The time to wait before starting to try to acquire the cluster lock. Note that if FileLockClusterService + * determines no cluster members are running or cannot reliably determine the cluster state, the initial delay is + * computed from the acquireLockInterval. */ private String acquireLockDelay; /** - * The time to wait between attempts to try to acquire lock. + * The time to wait between attempts to try to acquire the cluster lock evaluated using wall-clock time. All cluster + * members must use the same value so leadership checks and leader liveness detection remain consistent. */ private String acquireLockInterval; @@ -60,6 +63,23 @@ public class FileLockClusterServiceConfiguration { */ private Integer heartbeatTimeoutMultiplier; + /** + * The number of times a cluster data task will run, counting both the first execution and subsequent retries in + * case of failure or timeout. + *

+ * This can be useful when the cluster data root is on network based file storage, where I/O operations may + * occasionally block for long or unpredictable periods. + */ + private Integer clusterDataTaskMaxAttempts; + + /** + * The timeout for a cluster data task (reading or writing cluster data). + *

+ * Timeouts are useful when the cluster data root is on network storage, where I/O operations may occasionally block + * for long or unpredictable periods. + */ + private Long clusterDataTaskTimeout; + /** * Service lookup order/priority. */ @@ -128,4 +148,20 @@ public Integer getHeartbeatTimeoutMultiplier() { public void setHeartbeatTimeoutMultiplier(Integer heartbeatTimeoutMultiplier) { this.heartbeatTimeoutMultiplier = heartbeatTimeoutMultiplier; } + + public Integer getClusterDataTaskMaxAttempts() { + return clusterDataTaskMaxAttempts; + } + + public void setClusterDataTaskMaxAttempts(Integer clusterDataTaskMaxAttempts) { + this.clusterDataTaskMaxAttempts = clusterDataTaskMaxAttempts; + } + + public Long getClusterDataTaskTimeout() { + return clusterDataTaskTimeout; + } + + public void setClusterDataTaskTimeout(Long clusterDataTaskTimeout) { + this.clusterDataTaskTimeout = clusterDataTaskTimeout; + } }