Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
{
Expand All @@ -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. <p> 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). <p> 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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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.
* <p>
* 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).
* <p>
* 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.
*/
Expand Down Expand Up @@ -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;
}
}