This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


The following commit(s) were added to refs/heads/main by this push:
     new 8ca2075fe9 Update file-cluster-service configuration for recent 
FileLockClusterService enhancements
8ca2075fe9 is described below

commit 8ca2075fe90760f74a4daeab627775cbc142326e
Author: James Netherton <[email protected]>
AuthorDate: Thu Jan 22 11:41:05 2026 +0000

    Update file-cluster-service configuration for recent FileLockClusterService 
enhancements
---
 .../reference/extensions/file-cluster-service.adoc | 27 ++++++++++++++++++--
 ...LockClusterServiceConfigDefaultEnabledTest.java |  3 +++
 .../file/cluster/FileLockClusterServiceConfig.java | 29 ++++++++++++++++++++--
 .../cluster/FileLockClusterServiceRecorder.java    |  5 +++-
 4 files changed, 59 insertions(+), 5 deletions(-)

diff --git 
a/docs/modules/ROOT/pages/reference/extensions/file-cluster-service.adoc 
b/docs/modules/ROOT/pages/reference/extensions/file-cluster-service.adoc
index 5c2f483914..bdf8443efa 100644
--- a/docs/modules/ROOT/pages/reference/extensions/file-cluster-service.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/file-cluster-service.adoc
@@ -99,13 +99,17 @@ The custom attributes associated to the service (defaults 
to empty map).
 
 a|icon:lock[title=Fixed at build time] 
[[quarkus-camel-cluster-file-acquire-lock-delay]]`link:#quarkus-camel-cluster-file-acquire-lock-delay[quarkus.camel.cluster.file.acquire-lock-delay]`
 
-The time to wait before starting to try to acquire lock (defaults to 1000ms).
+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 (defaults to 1000ms).
 | `string`
 | 
 
 a|icon:lock[title=Fixed at build time] 
[[quarkus-camel-cluster-file-acquire-lock-interval]]`link:#quarkus-camel-cluster-file-acquire-lock-interval[quarkus.camel.cluster.file.acquire-lock-interval]`
 
-The time to wait between attempts to try to acquire lock (defaults to 10000ms).
+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 (defaults to
+10000ms).
 | `string`
 | 
 
@@ -119,6 +123,25 @@ followers will tolerate up to `2s * 3 = 6s` of silence 
before declaring the lead
 | `int`
 | 
 
+a|icon:lock[title=Fixed at build time] 
[[quarkus-camel-cluster-file-cluster-data-task-max-attempts]]`link:#quarkus-camel-cluster-file-cluster-data-task-max-attempts[quarkus.camel.cluster.file.cluster-data-task-max-attempts]`
+
+Sets how many times a cluster data task will run, counting both the first 
execution and subsequent retries in
+case of failure or timeout. The default is 5 attempts.
+
+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.
+| `int`
+| 
+
+a|icon:lock[title=Fixed at build time] 
[[quarkus-camel-cluster-file-cluster-data-task-timeout]]`link:#quarkus-camel-cluster-file-cluster-data-task-timeout[quarkus.camel.cluster.file.cluster-data-task-timeout]`
+
+Sets the timeout for a cluster data task (reading or writing cluster data). 
The default is 10 seconds.
+
+Timeouts are useful when the cluster data root is on network storage, where 
I/O operations may occasionally block
+for long or unpredictable periods.
+| `string`
+| 
+
 a|icon:lock[title=Fixed at build time] 
[[quarkus-camel-cluster-file-enabled]]`link:#quarkus-camel-cluster-file-enabled[quarkus.camel.cluster.file.enabled]`
 
 Whether a File Lock Cluster Service should be automatically configured 
according to
diff --git 
a/extensions/file-cluster-service/deployment/src/test/java/org/apache/camel/quarkus/component/file/cluster/deployment/FileLockClusterServiceConfigDefaultEnabledTest.java
 
b/extensions/file-cluster-service/deployment/src/test/java/org/apache/camel/quarkus/component/file/cluster/deployment/FileLockClusterServiceConfigDefaultEnabledTest.java
index b2de259b96..61010d49ea 100644
--- 
a/extensions/file-cluster-service/deployment/src/test/java/org/apache/camel/quarkus/component/file/cluster/deployment/FileLockClusterServiceConfigDefaultEnabledTest.java
+++ 
b/extensions/file-cluster-service/deployment/src/test/java/org/apache/camel/quarkus/component/file/cluster/deployment/FileLockClusterServiceConfigDefaultEnabledTest.java
@@ -85,5 +85,8 @@ public class FileLockClusterServiceConfigDefaultEnabledTest {
         assertEquals(10L, service.getAcquireLockInterval());
         assertEquals(TimeUnit.SECONDS, service.getAcquireLockIntervalUnit());
         assertEquals(5, service.getHeartbeatTimeoutMultiplier());
+        assertEquals(5, service.getClusterDataTaskMaxAttempts());
+        assertEquals(10, service.getClusterDataTaskTimeout());
+        assertEquals(TimeUnit.SECONDS, 
service.getClusterDataTaskTimeoutUnit());
     }
 }
diff --git 
a/extensions/file-cluster-service/runtime/src/main/java/org/apache/camel/quarkus/component/file/cluster/FileLockClusterServiceConfig.java
 
b/extensions/file-cluster-service/runtime/src/main/java/org/apache/camel/quarkus/component/file/cluster/FileLockClusterServiceConfig.java
index 4805140c07..6fb87babcd 100644
--- 
a/extensions/file-cluster-service/runtime/src/main/java/org/apache/camel/quarkus/component/file/cluster/FileLockClusterServiceConfig.java
+++ 
b/extensions/file-cluster-service/runtime/src/main/java/org/apache/camel/quarkus/component/file/cluster/FileLockClusterServiceConfig.java
@@ -69,14 +69,18 @@ public interface FileLockClusterServiceConfig {
     Map<String, String> attributes();
 
     /**
-     * The time to wait before starting to try to acquire lock (defaults to 
1000ms).
+     * 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 (defaults to 1000ms).
      *
      * @asciidoclet
      */
     Optional<String> acquireLockDelay();
 
     /**
-     * The time to wait between attempts to try to acquire lock (defaults to 
10000ms).
+     * 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 (defaults to
+     * 10000ms).
      *
      * @asciidoclet
      */
@@ -93,6 +97,27 @@ public interface FileLockClusterServiceConfig {
      */
     Optional<Integer> heartbeatTimeoutMultiplier();
 
+    /**
+     * Sets how many times a cluster data task will run, counting both the 
first execution and subsequent retries in
+     * case of failure or timeout. The default is 5 attempts.
+     *
+     * 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.
+     *
+     * @asciidoclet
+     */
+    Optional<Integer> clusterDataTaskMaxAttempts();
+
+    /**
+     * Sets the timeout for a cluster data task (reading or writing cluster 
data). The default is 10 seconds.
+     *
+     * Timeouts are useful when the cluster data root is on network storage, 
where I/O operations may occasionally block
+     * for long or unpredictable periods.
+     *
+     * @asciidoclet
+     */
+    Optional<String> clusterDataTaskTimeout();
+
     final class Enabled implements BooleanSupplier {
         FileLockClusterServiceConfig config;
 
diff --git 
a/extensions/file-cluster-service/runtime/src/main/java/org/apache/camel/quarkus/component/file/cluster/FileLockClusterServiceRecorder.java
 
b/extensions/file-cluster-service/runtime/src/main/java/org/apache/camel/quarkus/component/file/cluster/FileLockClusterServiceRecorder.java
index 0f61bbaa1b..69e2b2f39a 100644
--- 
a/extensions/file-cluster-service/runtime/src/main/java/org/apache/camel/quarkus/component/file/cluster/FileLockClusterServiceRecorder.java
+++ 
b/extensions/file-cluster-service/runtime/src/main/java/org/apache/camel/quarkus/component/file/cluster/FileLockClusterServiceRecorder.java
@@ -38,7 +38,10 @@ public class FileLockClusterServiceRecorder {
             
flcs.setAcquireLockInterval(TimePatternConverter.toMilliSeconds(interval), 
TimeUnit.MILLISECONDS);
         });
         
config.heartbeatTimeoutMultiplier().ifPresent(flcs::setHeartbeatTimeoutMultiplier);
-
+        
config.clusterDataTaskMaxAttempts().ifPresent(flcs::setClusterDataTaskMaxAttempts);
+        config.clusterDataTaskTimeout().ifPresent(clusterDataTaskTimeout -> {
+            
flcs.setClusterDataTaskTimeout(TimePatternConverter.toMilliSeconds(clusterDataTaskTimeout),
 TimeUnit.MILLISECONDS);
+        });
         config.attributes().forEach(flcs::setAttribute);
 
         return new RuntimeValue<>(flcs);

Reply via email to