You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2024/03/21 11:28:29 UTC

(camel) branch main updated: Expose and on Resilience4j configuration

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.git


The following commit(s) were added to refs/heads/main by this push:
     new e3640b5f502 Expose  and  on Resilience4j configuration
e3640b5f502 is described below

commit e3640b5f5023d06b043a8de6c8d2edfb21d33dca
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Mar 21 12:25:05 2024 +0100

    Expose  and  on Resilience4j configuration
---
 .../model/Resilience4jConfigurationDefinition.java  | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/core/camel-core-model/src/main/java/org/apache/camel/model/Resilience4jConfigurationDefinition.java b/core/camel-core-model/src/main/java/org/apache/camel/model/Resilience4jConfigurationDefinition.java
index 4f8f3298cd1..889e26c09ab 100644
--- a/core/camel-core-model/src/main/java/org/apache/camel/model/Resilience4jConfigurationDefinition.java
+++ b/core/camel-core-model/src/main/java/org/apache/camel/model/Resilience4jConfigurationDefinition.java
@@ -252,10 +252,25 @@ public class Resilience4jConfigurationDefinition extends Resilience4jConfigurati
     }
 
     /**
-     * Configures whether cancel is called on the running future. Defaults to true.
+     * Configure a list of exceptions that are recorded as a failure and thus increase the failure rate. Any exception
+     * matching or inheriting from one of the list counts as a failure, unless explicitly ignored via ignoreExceptions.
      */
-    public Resilience4jConfigurationDefinition timeoutCancelRunningFuture(boolean timeoutCancelRunningFuture) {
-        setTimeoutCancelRunningFuture(Boolean.toString(timeoutCancelRunningFuture));
+    public Resilience4jConfigurationDefinition recordException(Throwable... exception) {
+        for (Throwable t : exception) {
+            getRecordExceptions().add(t.getClass().getName());
+        }
+        return this;
+    }
+
+    /**
+     * Configure a list of exceptions that are ignored and neither count as a failure nor success. Any exception
+     * matching or inheriting from one of the list will not count as a failure nor success, even if the exceptions is
+     * part of recordExceptions.
+     */
+    public Resilience4jConfigurationDefinition ignoreException(Throwable... exception) {
+        for (Throwable t : exception) {
+            getIgnoreExceptions().add(t.getClass().getName());
+        }
         return this;
     }