This is an automated email from the ASF dual-hosted git repository. acosentino 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 a372f4ab641 [create-pull-request] automated change a372f4ab641 is described below commit a372f4ab641bdc69b41a98058d224bf1d13cbe86 Author: oscerd <osc...@users.noreply.github.com> AuthorDate: Sun May 14 01:01:47 2023 +0000 [create-pull-request] automated change --- .../camel-core-starter/src/main/docs/core.json | 48 +++++++++++ .../Resilience4jConfigurationDefinitionCommon.java | 97 ++++++++++++++++++++++ 2 files changed, 145 insertions(+) diff --git a/components-starter/camel-core-starter/src/main/docs/core.json b/components-starter/camel-core-starter/src/main/docs/core.json index a3a5e759ecc..56e6475d7bf 100644 --- a/components-starter/camel-core-starter/src/main/docs/core.json +++ b/components-starter/camel-core-starter/src/main/docs/core.json @@ -519,6 +519,27 @@ "sourceType": "org.apache.camel.model.springboot.Resilience4jConfigurationDefinitionProperties", "defaultValue": false }, + { + "name": "camel.resilience4j.bulkhead-enabled", + "type": "java.lang.Boolean", + "description": "Whether bulkhead is enabled or not on the circuit breaker. Default is false.", + "sourceType": "org.apache.camel.model.springboot.Resilience4jConfigurationDefinitionProperties", + "defaultValue": false + }, + { + "name": "camel.resilience4j.bulkhead-max-concurrent-calls", + "type": "java.lang.Integer", + "description": "Configures the max amount of concurrent calls the bulkhead will support.", + "sourceType": "org.apache.camel.model.springboot.Resilience4jConfigurationDefinitionProperties", + "defaultValue": 25 + }, + { + "name": "camel.resilience4j.bulkhead-max-wait-duration", + "type": "java.lang.Integer", + "description": "Configures a maximum amount of time which the calling thread will wait to enter the bulkhead. If bulkhead has space available, entry is guaranteed and immediate. If bulkhead is full, calling threads will contest for space, if it becomes available. maxWaitDuration can be set to 0. Note: for threads running on an event-loop or equivalent (rx computation pool, etc), setting maxWaitDuration to 0 is highly recommended. Blocking an event-loop thread will most likely have [...] + "sourceType": "org.apache.camel.model.springboot.Resilience4jConfigurationDefinitionProperties", + "defaultValue": 0 + }, { "name": "camel.resilience4j.circuit-breaker", "type": "java.lang.String", @@ -598,6 +619,33 @@ "sourceType": "org.apache.camel.model.springboot.Resilience4jConfigurationDefinitionProperties", "defaultValue": false }, + { + "name": "camel.resilience4j.timeout-cancel-running-future", + "type": "java.lang.Boolean", + "description": "Configures whether cancel is called on the running future. Defaults to true.", + "sourceType": "org.apache.camel.model.springboot.Resilience4jConfigurationDefinitionProperties", + "defaultValue": true + }, + { + "name": "camel.resilience4j.timeout-duration", + "type": "java.lang.Integer", + "description": "Configures the thread execution timeout. Default value is 1 second.", + "sourceType": "org.apache.camel.model.springboot.Resilience4jConfigurationDefinitionProperties", + "defaultValue": 1000 + }, + { + "name": "camel.resilience4j.timeout-enabled", + "type": "java.lang.Boolean", + "description": "Whether timeout is enabled or not on the circuit breaker. Default is false.", + "sourceType": "org.apache.camel.model.springboot.Resilience4jConfigurationDefinitionProperties", + "defaultValue": false + }, + { + "name": "camel.resilience4j.timeout-executor-service", + "type": "java.util.concurrent.ExecutorService", + "description": "References to a custom thread pool to use when timeout is enabled (uses ForkJoinPool#commonPool() by default)", + "sourceType": "org.apache.camel.model.springboot.Resilience4jConfigurationDefinitionProperties" + }, { "name": "camel.resilience4j.wait-duration-in-open-state", "type": "java.lang.Integer", diff --git a/components-starter/camel-core-starter/src/main/java/org/apache/camel/model/springboot/Resilience4jConfigurationDefinitionCommon.java b/components-starter/camel-core-starter/src/main/java/org/apache/camel/model/springboot/Resilience4jConfigurationDefinitionCommon.java index 4084e9e5cba..c77048b0d7f 100644 --- a/components-starter/camel-core-starter/src/main/java/org/apache/camel/model/springboot/Resilience4jConfigurationDefinitionCommon.java +++ b/components-starter/camel-core-starter/src/main/java/org/apache/camel/model/springboot/Resilience4jConfigurationDefinitionCommon.java @@ -16,6 +16,8 @@ */ package org.apache.camel.model.springboot; +import java.util.concurrent.ExecutorService; + /** * Resilience4j Circuit Breaker EIP configuration * @@ -121,6 +123,45 @@ public class Resilience4jConfigurationDefinitionCommon { * is 60 seconds. */ private Integer slowCallDurationThreshold = 60; + /** + * Whether bulkhead is enabled or not on the circuit breaker. Default is + * false. + */ + private Boolean bulkheadEnabled = false; + /** + * Configures the max amount of concurrent calls the bulkhead will support. + */ + private Integer bulkheadMaxConcurrentCalls = 25; + /** + * Configures a maximum amount of time which the calling thread will wait to + * enter the bulkhead. If bulkhead has space available, entry is guaranteed + * and immediate. If bulkhead is full, calling threads will contest for + * space, if it becomes available. maxWaitDuration can be set to 0. Note: + * for threads running on an event-loop or equivalent (rx computation pool, + * etc), setting maxWaitDuration to 0 is highly recommended. Blocking an + * event-loop thread will most likely have a negative effect on application + * throughput. + */ + private Integer bulkheadMaxWaitDuration = 0; + /** + * Whether timeout is enabled or not on the circuit breaker. Default is + * false. + */ + private Boolean timeoutEnabled = false; + /** + * References to a custom thread pool to use when timeout is enabled (uses + * ForkJoinPool#commonPool() by default) + */ + private ExecutorService timeoutExecutorService; + /** + * Configures the thread execution timeout. Default value is 1 second. + */ + private Integer timeoutDuration = 1000; + /** + * Configures whether cancel is called on the running future. Defaults to + * true. + */ + private Boolean timeoutCancelRunningFuture = true; public String getCircuitBreaker() { return circuitBreaker; @@ -228,4 +269,60 @@ public class Resilience4jConfigurationDefinitionCommon { public void setSlowCallDurationThreshold(Integer slowCallDurationThreshold) { this.slowCallDurationThreshold = slowCallDurationThreshold; } + + public Boolean getBulkheadEnabled() { + return bulkheadEnabled; + } + + public void setBulkheadEnabled(Boolean bulkheadEnabled) { + this.bulkheadEnabled = bulkheadEnabled; + } + + public Integer getBulkheadMaxConcurrentCalls() { + return bulkheadMaxConcurrentCalls; + } + + public void setBulkheadMaxConcurrentCalls(Integer bulkheadMaxConcurrentCalls) { + this.bulkheadMaxConcurrentCalls = bulkheadMaxConcurrentCalls; + } + + public Integer getBulkheadMaxWaitDuration() { + return bulkheadMaxWaitDuration; + } + + public void setBulkheadMaxWaitDuration(Integer bulkheadMaxWaitDuration) { + this.bulkheadMaxWaitDuration = bulkheadMaxWaitDuration; + } + + public Boolean getTimeoutEnabled() { + return timeoutEnabled; + } + + public void setTimeoutEnabled(Boolean timeoutEnabled) { + this.timeoutEnabled = timeoutEnabled; + } + + public ExecutorService getTimeoutExecutorService() { + return timeoutExecutorService; + } + + public void setTimeoutExecutorService(ExecutorService timeoutExecutorService) { + this.timeoutExecutorService = timeoutExecutorService; + } + + public Integer getTimeoutDuration() { + return timeoutDuration; + } + + public void setTimeoutDuration(Integer timeoutDuration) { + this.timeoutDuration = timeoutDuration; + } + + public Boolean getTimeoutCancelRunningFuture() { + return timeoutCancelRunningFuture; + } + + public void setTimeoutCancelRunningFuture(Boolean timeoutCancelRunningFuture) { + this.timeoutCancelRunningFuture = timeoutCancelRunningFuture; + } } \ No newline at end of file