This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
The following commit(s) were added to refs/heads/main by this push:
new 10381588f57 CAMEL-22430: Add heartbeatTimeoutMultiplier configuration
option to camel-file-cluster-service-starter (#1512)
10381588f57 is described below
commit 10381588f57d45e61158303983646811ac2f42e3
Author: James Netherton <[email protected]>
AuthorDate: Mon Sep 22 11:47:08 2025 +0100
CAMEL-22430: Add heartbeatTimeoutMultiplier configuration option to
camel-file-cluster-service-starter (#1512)
---
.../src/main/docs/file-cluster-service.json | 6 ++++++
.../cluster/FileLockClusterServiceAutoConfiguration.java | 1 +
.../cluster/FileLockClusterServiceConfiguration.java | 16 ++++++++++++++++
3 files changed, 23 insertions(+)
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 be4870eeb8f..375e915b00f 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
@@ -32,6 +32,12 @@
"sourceType":
"org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration",
"defaultValue": true
},
+ {
+ "name": "camel.cluster.file.heartbeat-timeout-multiplier",
+ "type": "java.lang.Integer",
+ "description": "Multiplier applied to the cluster leader
acquireLockInterval to determine how long followers should wait before
considering the leader \"stale\". For example, if the leader updates its
heartbeat every 2 seconds and the heartbeatTimeoutMultiplier is 3, followers
will tolerate up to 2s * 3 = 6s of silence before declaring the leader
unavailable.",
+ "sourceType":
"org.apache.camel.component.file.springboot.cluster.FileLockClusterServiceConfiguration"
+ },
{
"name": "camel.cluster.file.id",
"type": "java.lang.String",
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 e1cd126ba68..e725ac8f7a7 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
@@ -54,6 +54,7 @@ public class FileLockClusterServiceAutoConfiguration {
.ifPresent(v -> service.setAcquireLockDelay(v,
TimeUnit.MILLISECONDS));
Optional.ofNullable(configuration.getAcquireLockInterval()).map(TimePatternConverter::toMilliSeconds)
.ifPresent(v -> service.setAcquireLockInterval(v,
TimeUnit.MILLISECONDS));
+
Optional.ofNullable(configuration.getHeartbeatTimeoutMultiplier()).ifPresent(service::setHeartbeatTimeoutMultiplier);
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 f1ee76691c6..c87c6a9aaff 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
@@ -52,6 +52,14 @@ public class FileLockClusterServiceConfiguration {
*/
private Map<String, Object> attributes;
+ /**
+ * Multiplier applied to the cluster leader acquireLockInterval to
determine how long followers should wait
+ * before considering the leader "stale".
+ * For example, if the leader updates its heartbeat every 2 seconds and
the heartbeatTimeoutMultiplier is 3,
+ * followers will tolerate up to 2s * 3 = 6s of silence before declaring
the leader unavailable.
+ */
+ private Integer heartbeatTimeoutMultiplier;
+
/**
* Service lookup order/priority.
*/
@@ -112,4 +120,12 @@ public class FileLockClusterServiceConfiguration {
public void setOrder(Integer order) {
this.order = order;
}
+
+ public Integer getHeartbeatTimeoutMultiplier() {
+ return heartbeatTimeoutMultiplier;
+ }
+
+ public void setHeartbeatTimeoutMultiplier(Integer
heartbeatTimeoutMultiplier) {
+ this.heartbeatTimeoutMultiplier = heartbeatTimeoutMultiplier;
+ }
}