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

davsclaus pushed a commit to branch inherit
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 10353dcf3875423977b8fb8b4a1969b0df50cde4
Author: Claus Ibsen <[email protected]>
AuthorDate: Sun Jan 19 20:15:16 2025 +0100

    CAMEL-21630: camel-core - InheritErrorHandler should only be for failover 
LB and internally only for camel-jta
---
 .../camel/catalog/models/circuitBreaker.json       |  2 +-
 .../camel/catalog/models/failoverLoadBalancer.json |  2 +-
 .../apache/camel/catalog/schemas/camel-spring.xsd  |  8 +++--
 .../FailOverLoadBalanceAutoStartupFalseTest.xml    |  4 +--
 .../org/apache/camel/model/circuitBreaker.json     |  2 +-
 .../model/loadbalancer/failoverLoadBalancer.json   |  2 +-
 .../camel/model/CircuitBreakerDefinition.java      | 14 +++++++--
 .../camel/model/InheritErrorHandlerAware.java      | 34 ----------------------
 .../apache/camel/model/ProcessorDefinition.java    |  4 +--
 .../FailoverLoadBalancerDefinition.java            |  7 ++---
 .../java/org/apache/camel/xml/out/ModelWriter.java |  4 +--
 .../org/apache/camel/yaml/out/ModelWriter.java     |  4 +--
 .../dsl/yaml/deserializers/ModelDeserializers.java |  2 +-
 13 files changed, 30 insertions(+), 59 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/circuitBreaker.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/circuitBreaker.json
index 38fb8bf7d20..575c3a45fbf 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/circuitBreaker.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/circuitBreaker.json
@@ -16,7 +16,7 @@
     "description": { "index": 1, "kind": "attribute", "displayName": 
"Description", "group": "common", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "description": "Sets the description of this node" },
     "disabled": { "index": 2, "kind": "attribute", "displayName": "Disabled", 
"group": "advanced", "label": "advanced", "required": false, "type": "boolean", 
"javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": false, "description": "Whether to disable this 
EIP from the route during build time. Once an EIP has been disabled then it 
cannot be enabled later at runtime." },
     "configuration": { "index": 3, "kind": "attribute", "displayName": 
"Configuration", "group": "common", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "description": "Refers to a circuit breaker configuration 
(such as resillience4j, or microprofile-fault-tolerance) to use for configuring 
the circuit breaker EIP." },
-    "inheritErrorHandler": { "index": 4, "kind": "attribute", "displayName": 
"Inherit Error Handler", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": "To 
turn on or off Camel error handling during circuit breaker (only failover load 
balancer is supported)." },
+    "inheritErrorHandler": { "index": 4, "kind": "attribute", "displayName": 
"Inherit Error Handler", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": "To 
turn on or off Camel error handling during circuit breaker. If this is enabled 
then Camel error handler will first trigger if there is an error in the circuit 
breaker, which all [...]
     "resilience4jConfiguration": { "index": 5, "kind": "element", 
"displayName": "Resilience4j Configuration", "group": "common", "required": 
false, "type": "object", "javaType": 
"org.apache.camel.model.Resilience4jConfigurationDefinition", "deprecated": 
false, "autowired": false, "secret": false, "description": "Configures the 
circuit breaker to use Resilience4j with the given configuration." },
     "faultToleranceConfiguration": { "index": 6, "kind": "element", 
"displayName": "Fault Tolerance Configuration", "group": "common", "required": 
false, "type": "object", "javaType": 
"org.apache.camel.model.FaultToleranceConfigurationDefinition", "deprecated": 
false, "autowired": false, "secret": false, "description": "Configures the 
circuit breaker to use MicroProfile Fault Tolerance with the given 
configuration." },
     "onFallback": { "index": 7, "kind": "element", "displayName": "On 
Fallback", "group": "common", "required": false, "type": "object", "javaType": 
"org.apache.camel.model.OnFallbackDefinition", "deprecated": false, 
"autowired": false, "secret": false, "description": "The fallback route path to 
execute that does not go over the network. This should be a static or cached 
result that can immediately be returned upon failure. If the fallback requires 
network connection then use onFallbackV [...]
diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/failoverLoadBalancer.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/failoverLoadBalancer.json
index 5ff26a82102..e0bc89dd7ad 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/failoverLoadBalancer.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/models/failoverLoadBalancer.json
@@ -17,6 +17,6 @@
     "roundRobin": { "index": 2, "kind": "attribute", "displayName": "Round 
Robin", "group": "common", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "autowired": false, "secret": false, 
"description": "Whether or not the failover load balancer should operate in 
round robin mode or not. If not, then it will always start from the first 
endpoint when a new message is to be processed. In other words it restart from 
the top for every message. If roun [...]
     "sticky": { "index": 3, "kind": "attribute", "displayName": "Sticky", 
"group": "common", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "autowired": false, "secret": false, 
"description": "Whether or not the failover load balancer should operate in 
sticky mode or not. If not, then it will always start from the first endpoint 
when a new message is to be processed. In other words it restart from the top 
for every message. If sticky is enabled, [...]
     "maximumFailoverAttempts": { "index": 4, "kind": "attribute", 
"displayName": "Maximum Failover Attempts", "group": "common", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": "-1", "description": "A 
value to indicate after X failover attempts we should exhaust (give up). Use -1 
to indicate never give up and continuously try to failover. Use 0 to never 
failover. And use e.g. 3 to failover at m [...]
-    "inheritErrorHandler": { "index": 5, "kind": "attribute", "displayName": 
"Inherit Error Handler", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": "To 
turn off Camel error handling during load balancing. By default, Camel error 
handler will attempt calling a service, which means you can specify retires and 
other fine-grained s [...]
+    "inheritErrorHandler": { "index": 5, "kind": "attribute", "displayName": 
"Inherit Error Handler", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": true, "description": "To 
turn off Camel error handling during load balancing. By default, Camel error 
handler will attempt calling a service, which means you can specify retires and 
other fine-grained se [...]
   }
 }
diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
index 0ad9c341cd4..7b650d74165 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/schemas/camel-spring.xsd
@@ -4716,8 +4716,10 @@ configuring the circuit breaker EIP.
           <xs:annotation>
             <xs:documentation xml:lang="en">
 <![CDATA[
-To turn on or off Camel error handling during circuit breaker (only failover 
load balancer is supported). Default value:
-false
+To turn on or off Camel error handling during circuit breaker. If this is 
enabled then Camel error handler will first
+trigger if there is an error in the circuit breaker, which allows to let Camel 
handle redeliveries. If all attempts is
+failed, then after the circuit breaker is finished, then Camel error handler 
can handle the error as well such as the
+dead letter channel. By default, Camel error handler is turned off. Default 
value: false
 ]]>
             </xs:documentation>
           </xs:annotation>
@@ -7155,7 +7157,7 @@ option can be used whether roundRobin is enabled or not. 
Default value: -1
 To turn off Camel error handling during load balancing. By default, Camel 
error handler will attempt calling a service,
 which means you can specify retires and other fine-grained settings. And only 
when Camel error handler have failed all
 attempts, then this load balancer will fail over to the next endpoint and try 
again. You can turn this off, and then
-this load balancer will fail over immediately on an error. Default value: false
+this load balancer will fail over immediately on an error. Default value: true
 ]]>
             </xs:documentation>
           </xs:annotation>
diff --git 
a/components/camel-spring-xml/src/test/resources/org/apache/camel/spring/processor/FailOverLoadBalanceAutoStartupFalseTest.xml
 
b/components/camel-spring-xml/src/test/resources/org/apache/camel/spring/processor/FailOverLoadBalanceAutoStartupFalseTest.xml
index 31436ab5713..98c80256c74 100644
--- 
a/components/camel-spring-xml/src/test/resources/org/apache/camel/spring/processor/FailOverLoadBalanceAutoStartupFalseTest.xml
+++ 
b/components/camel-spring-xml/src/test/resources/org/apache/camel/spring/processor/FailOverLoadBalanceAutoStartupFalseTest.xml
@@ -29,8 +29,8 @@
 
     <route id="foo" autoStartup="false">
       <from uri="direct:start"/>
-      <loadBalance inheritErrorHandler="true">
-        <failoverLoadBalancer maximumFailoverAttempts="3" roundRobin="true"/>
+      <loadBalance>
+        <failoverLoadBalancer maximumFailoverAttempts="3" roundRobin="true" 
inheritErrorHandler="true"/>
         <to uri="direct:x"/>
         <to uri="direct:y"/>
         <to uri="direct:z"/>
diff --git 
a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/circuitBreaker.json
 
b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/circuitBreaker.json
index 38fb8bf7d20..575c3a45fbf 100644
--- 
a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/circuitBreaker.json
+++ 
b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/circuitBreaker.json
@@ -16,7 +16,7 @@
     "description": { "index": 1, "kind": "attribute", "displayName": 
"Description", "group": "common", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "description": "Sets the description of this node" },
     "disabled": { "index": 2, "kind": "attribute", "displayName": "Disabled", 
"group": "advanced", "label": "advanced", "required": false, "type": "boolean", 
"javaType": "java.lang.Boolean", "deprecated": false, "autowired": false, 
"secret": false, "defaultValue": false, "description": "Whether to disable this 
EIP from the route during build time. Once an EIP has been disabled then it 
cannot be enabled later at runtime." },
     "configuration": { "index": 3, "kind": "attribute", "displayName": 
"Configuration", "group": "common", "required": false, "type": "string", 
"javaType": "java.lang.String", "deprecated": false, "autowired": false, 
"secret": false, "description": "Refers to a circuit breaker configuration 
(such as resillience4j, or microprofile-fault-tolerance) to use for configuring 
the circuit breaker EIP." },
-    "inheritErrorHandler": { "index": 4, "kind": "attribute", "displayName": 
"Inherit Error Handler", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": "To 
turn on or off Camel error handling during circuit breaker (only failover load 
balancer is supported)." },
+    "inheritErrorHandler": { "index": 4, "kind": "attribute", "displayName": 
"Inherit Error Handler", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": "To 
turn on or off Camel error handling during circuit breaker. If this is enabled 
then Camel error handler will first trigger if there is an error in the circuit 
breaker, which all [...]
     "resilience4jConfiguration": { "index": 5, "kind": "element", 
"displayName": "Resilience4j Configuration", "group": "common", "required": 
false, "type": "object", "javaType": 
"org.apache.camel.model.Resilience4jConfigurationDefinition", "deprecated": 
false, "autowired": false, "secret": false, "description": "Configures the 
circuit breaker to use Resilience4j with the given configuration." },
     "faultToleranceConfiguration": { "index": 6, "kind": "element", 
"displayName": "Fault Tolerance Configuration", "group": "common", "required": 
false, "type": "object", "javaType": 
"org.apache.camel.model.FaultToleranceConfigurationDefinition", "deprecated": 
false, "autowired": false, "secret": false, "description": "Configures the 
circuit breaker to use MicroProfile Fault Tolerance with the given 
configuration." },
     "onFallback": { "index": 7, "kind": "element", "displayName": "On 
Fallback", "group": "common", "required": false, "type": "object", "javaType": 
"org.apache.camel.model.OnFallbackDefinition", "deprecated": false, 
"autowired": false, "secret": false, "description": "The fallback route path to 
execute that does not go over the network. This should be a static or cached 
result that can immediately be returned upon failure. If the fallback requires 
network connection then use onFallbackV [...]
diff --git 
a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/loadbalancer/failoverLoadBalancer.json
 
b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/loadbalancer/failoverLoadBalancer.json
index 5ff26a82102..e0bc89dd7ad 100644
--- 
a/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/loadbalancer/failoverLoadBalancer.json
+++ 
b/core/camel-core-model/src/generated/resources/META-INF/org/apache/camel/model/loadbalancer/failoverLoadBalancer.json
@@ -17,6 +17,6 @@
     "roundRobin": { "index": 2, "kind": "attribute", "displayName": "Round 
Robin", "group": "common", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "autowired": false, "secret": false, 
"description": "Whether or not the failover load balancer should operate in 
round robin mode or not. If not, then it will always start from the first 
endpoint when a new message is to be processed. In other words it restart from 
the top for every message. If roun [...]
     "sticky": { "index": 3, "kind": "attribute", "displayName": "Sticky", 
"group": "common", "required": false, "type": "string", "javaType": 
"java.lang.String", "deprecated": false, "autowired": false, "secret": false, 
"description": "Whether or not the failover load balancer should operate in 
sticky mode or not. If not, then it will always start from the first endpoint 
when a new message is to be processed. In other words it restart from the top 
for every message. If sticky is enabled, [...]
     "maximumFailoverAttempts": { "index": 4, "kind": "attribute", 
"displayName": "Maximum Failover Attempts", "group": "common", "required": 
false, "type": "string", "javaType": "java.lang.String", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": "-1", "description": "A 
value to indicate after X failover attempts we should exhaust (give up). Use -1 
to indicate never give up and continuously try to failover. Use 0 to never 
failover. And use e.g. 3 to failover at m [...]
-    "inheritErrorHandler": { "index": 5, "kind": "attribute", "displayName": 
"Inherit Error Handler", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": false, "description": "To 
turn off Camel error handling during load balancing. By default, Camel error 
handler will attempt calling a service, which means you can specify retires and 
other fine-grained s [...]
+    "inheritErrorHandler": { "index": 5, "kind": "attribute", "displayName": 
"Inherit Error Handler", "group": "advanced", "label": "advanced", "required": 
false, "type": "boolean", "javaType": "java.lang.Boolean", "deprecated": false, 
"autowired": false, "secret": false, "defaultValue": true, "description": "To 
turn off Camel error handling during load balancing. By default, Camel error 
handler will attempt calling a service, which means you can specify retires and 
other fine-grained se [...]
   }
 }
diff --git 
a/core/camel-core-model/src/main/java/org/apache/camel/model/CircuitBreakerDefinition.java
 
b/core/camel-core-model/src/main/java/org/apache/camel/model/CircuitBreakerDefinition.java
index 57c19a1345b..7d420c92b02 100644
--- 
a/core/camel-core-model/src/main/java/org/apache/camel/model/CircuitBreakerDefinition.java
+++ 
b/core/camel-core-model/src/main/java/org/apache/camel/model/CircuitBreakerDefinition.java
@@ -35,12 +35,12 @@ import org.apache.camel.spi.Metadata;
 @XmlRootElement(name = "circuitBreaker")
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(propOrder = { "resilience4jConfiguration", 
"faultToleranceConfiguration", "outputs", "onFallback" })
-public class CircuitBreakerDefinition extends 
OutputDefinition<CircuitBreakerDefinition> implements InheritErrorHandlerAware {
+public class CircuitBreakerDefinition extends 
OutputDefinition<CircuitBreakerDefinition> {
 
     @XmlAttribute
     private String configuration;
     @XmlAttribute
-    @Metadata(label = "advanced", javaType = "java.lang.Boolean")
+    @Metadata(label = "advanced", javaType = "java.lang.Boolean", defaultValue 
= "false")
     private Boolean inheritErrorHandler;
     @XmlElement
     private Resilience4jConfigurationDefinition resilience4jConfiguration;
@@ -131,10 +131,12 @@ public class CircuitBreakerDefinition extends 
OutputDefinition<CircuitBreakerDef
         this.configuration = configuration;
     }
 
+    @Override
     public Boolean getInheritErrorHandler() {
         return inheritErrorHandler;
     }
 
+    @Override
     public void setInheritErrorHandler(Boolean inheritErrorHandler) {
         this.inheritErrorHandler = inheritErrorHandler;
     }
@@ -196,7 +198,13 @@ public class CircuitBreakerDefinition extends 
OutputDefinition<CircuitBreakerDef
     }
 
     /**
-     * To turn on or off Camel error handling during circuit breaker (only 
failover load balancer is supported).
+     * To turn on or off Camel error handling during circuit breaker.
+     *
+     * If this is enabled then Camel error handler will first trigger if there 
is an error in the circuit breaker, which
+     * allows to let Camel handle redeliveries. If all attempts is failed, 
then after the circuit breaker is finished,
+     * then Camel error handler can handle the error as well such as the dead 
letter channel.
+     *
+     * By default, Camel error handler is turned off.
      */
     public CircuitBreakerDefinition inheritErrorHandler(boolean 
inheritErrorHandler) {
         this.inheritErrorHandler = inheritErrorHandler;
diff --git 
a/core/camel-core-model/src/main/java/org/apache/camel/model/InheritErrorHandlerAware.java
 
b/core/camel-core-model/src/main/java/org/apache/camel/model/InheritErrorHandlerAware.java
deleted file mode 100644
index ce9a5cd1c01..00000000000
--- 
a/core/camel-core-model/src/main/java/org/apache/camel/model/InheritErrorHandlerAware.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.model;
-
-/**
- * Whether an EIP supports the special inherit error handler mode.
- */
-public interface InheritErrorHandlerAware {
-
-    /**
-     * To turn off inheriting Camel error handler in this EIP.
-     */
-    Boolean getInheritErrorHandler();
-
-    /**
-     * To turn off inheriting Camel error handler in this EIP.
-     */
-    void setInheritErrorHandler(Boolean inheritErrorHandler);
-
-}
diff --git 
a/core/camel-core-model/src/main/java/org/apache/camel/model/ProcessorDefinition.java
 
b/core/camel-core-model/src/main/java/org/apache/camel/model/ProcessorDefinition.java
index 3f421df62ef..eb9c0cf2c41 100644
--- 
a/core/camel-core-model/src/main/java/org/apache/camel/model/ProcessorDefinition.java
+++ 
b/core/camel-core-model/src/main/java/org/apache/camel/model/ProcessorDefinition.java
@@ -79,7 +79,7 @@ import org.slf4j.Logger;
 @XmlAccessorType(XmlAccessType.FIELD)
 @SuppressWarnings("rawtypes")
 public abstract class ProcessorDefinition<Type extends 
ProcessorDefinition<Type>> extends OptionalIdentifiedDefinition<Type>
-        implements Block, CopyableDefinition<ProcessorDefinition>, 
DisabledAwareDefinition, InheritErrorHandlerAware {
+        implements Block, CopyableDefinition<ProcessorDefinition>, 
DisabledAwareDefinition {
     @XmlTransient
     private static final AtomicInteger COUNTER = new AtomicInteger();
     @XmlAttribute
@@ -4295,12 +4295,10 @@ public abstract class ProcessorDefinition<Type extends 
ProcessorDefinition<Type>
         this.disabled = disabled;
     }
 
-    @Override
     public Boolean getInheritErrorHandler() {
         return inheritErrorHandler;
     }
 
-    @Override
     public void setInheritErrorHandler(Boolean inheritErrorHandler) {
         this.inheritErrorHandler = inheritErrorHandler;
     }
diff --git 
a/core/camel-core-model/src/main/java/org/apache/camel/model/loadbalancer/FailoverLoadBalancerDefinition.java
 
b/core/camel-core-model/src/main/java/org/apache/camel/model/loadbalancer/FailoverLoadBalancerDefinition.java
index b1c24c40c32..4075965a28c 100644
--- 
a/core/camel-core-model/src/main/java/org/apache/camel/model/loadbalancer/FailoverLoadBalancerDefinition.java
+++ 
b/core/camel-core-model/src/main/java/org/apache/camel/model/loadbalancer/FailoverLoadBalancerDefinition.java
@@ -26,7 +26,6 @@ import jakarta.xml.bind.annotation.XmlElement;
 import jakarta.xml.bind.annotation.XmlRootElement;
 import jakarta.xml.bind.annotation.XmlTransient;
 
-import org.apache.camel.model.InheritErrorHandlerAware;
 import org.apache.camel.model.LoadBalancerDefinition;
 import org.apache.camel.spi.Metadata;
 
@@ -36,7 +35,7 @@ import org.apache.camel.spi.Metadata;
 @Metadata(label = "eip,routing")
 @XmlRootElement(name = "failoverLoadBalancer")
 @XmlAccessorType(XmlAccessType.FIELD)
-public class FailoverLoadBalancerDefinition extends LoadBalancerDefinition 
implements InheritErrorHandlerAware {
+public class FailoverLoadBalancerDefinition extends LoadBalancerDefinition {
 
     @XmlTransient
     private List<Class<?>> exceptionTypes = new ArrayList<>();
@@ -51,7 +50,7 @@ public class FailoverLoadBalancerDefinition extends 
LoadBalancerDefinition imple
     @Metadata(defaultValue = "-1")
     private String maximumFailoverAttempts;
     @XmlAttribute
-    @Metadata(label = "advanced", javaType = "java.lang.Boolean")
+    @Metadata(label = "advanced", javaType = "java.lang.Boolean", defaultValue 
= "true")
     private Boolean inheritErrorHandler;
 
     public FailoverLoadBalancerDefinition() {
@@ -141,7 +140,6 @@ public class FailoverLoadBalancerDefinition extends 
LoadBalancerDefinition imple
         this.maximumFailoverAttempts = maximumFailoverAttempts;
     }
 
-    @Override
     public Boolean getInheritErrorHandler() {
         return inheritErrorHandler;
     }
@@ -154,7 +152,6 @@ public class FailoverLoadBalancerDefinition extends 
LoadBalancerDefinition imple
      * fail over to the next endpoint and try again. You can turn this off, 
and then this load balancer will fail over
      * immediately on an error.
      */
-    @Override
     public void setInheritErrorHandler(Boolean inheritErrorHandler) {
         this.inheritErrorHandler = inheritErrorHandler;
     }
diff --git 
a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java
 
b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java
index b09f3628a53..931fc47b8b3 100644
--- 
a/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java
+++ 
b/core/camel-xml-io/src/generated/java/org/apache/camel/xml/out/ModelWriter.java
@@ -888,7 +888,7 @@ public class ModelWriter extends BaseWriter {
     protected void doWriteCircuitBreakerDefinition(String name, 
CircuitBreakerDefinition def) throws IOException {
         startElement(name);
         doWriteProcessorDefinitionAttributes(def);
-        doWriteAttribute("inheritErrorHandler", 
toString(def.getInheritErrorHandler()), null);
+        doWriteAttribute("inheritErrorHandler", 
toString(def.getInheritErrorHandler()), "false");
         doWriteAttribute("configuration", def.getConfiguration(), null);
         doWriteElement("resilience4jConfiguration", 
def.getResilience4jConfiguration(), 
this::doWriteResilience4jConfigurationDefinition);
         doWriteElement("onFallback", def.getOnFallback(), 
this::doWriteOnFallbackDefinition);
@@ -3267,7 +3267,7 @@ public class ModelWriter extends BaseWriter {
     protected void doWriteFailoverLoadBalancerDefinition(String name, 
FailoverLoadBalancerDefinition def) throws IOException {
         startElement(name);
         doWriteIdentifiedTypeAttributes(def);
-        doWriteAttribute("inheritErrorHandler", 
toString(def.getInheritErrorHandler()), null);
+        doWriteAttribute("inheritErrorHandler", 
toString(def.getInheritErrorHandler()), "true");
         doWriteAttribute("sticky", def.getSticky(), null);
         doWriteAttribute("maximumFailoverAttempts", 
def.getMaximumFailoverAttempts(), "-1");
         doWriteAttribute("roundRobin", def.getRoundRobin(), null);
diff --git 
a/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java
 
b/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java
index 118eeb9d37a..a4aa07d8b4e 100644
--- 
a/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java
+++ 
b/core/camel-yaml-io/src/generated/java/org/apache/camel/yaml/out/ModelWriter.java
@@ -888,7 +888,7 @@ public class ModelWriter extends BaseWriter {
     protected void doWriteCircuitBreakerDefinition(String name, 
CircuitBreakerDefinition def) throws IOException {
         startElement(name);
         doWriteProcessorDefinitionAttributes(def);
-        doWriteAttribute("inheritErrorHandler", 
toString(def.getInheritErrorHandler()), null);
+        doWriteAttribute("inheritErrorHandler", 
toString(def.getInheritErrorHandler()), "false");
         doWriteAttribute("configuration", def.getConfiguration(), null);
         doWriteElement("resilience4jConfiguration", 
def.getResilience4jConfiguration(), 
this::doWriteResilience4jConfigurationDefinition);
         doWriteElement("onFallback", def.getOnFallback(), 
this::doWriteOnFallbackDefinition);
@@ -3267,7 +3267,7 @@ public class ModelWriter extends BaseWriter {
     protected void doWriteFailoverLoadBalancerDefinition(String name, 
FailoverLoadBalancerDefinition def) throws IOException {
         startElement(name);
         doWriteIdentifiedTypeAttributes(def);
-        doWriteAttribute("inheritErrorHandler", 
toString(def.getInheritErrorHandler()), null);
+        doWriteAttribute("inheritErrorHandler", 
toString(def.getInheritErrorHandler()), "true");
         doWriteAttribute("sticky", def.getSticky(), null);
         doWriteAttribute("maximumFailoverAttempts", 
def.getMaximumFailoverAttempts(), "-1");
         doWriteAttribute("roundRobin", def.getRoundRobin(), null);
diff --git 
a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
 
b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
index d18533f53a1..aefab1977f5 100644
--- 
a/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
+++ 
b/dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/generated/java/org/apache/camel/dsl/yaml/deserializers/ModelDeserializers.java
@@ -2042,7 +2042,7 @@ public final class ModelDeserializers extends 
YamlDeserializerSupport {
                     @YamlProperty(name = "disabled", type = "boolean", 
description = "Whether to disable this EIP from the route during build time. 
Once an EIP has been disabled then it cannot be enabled later at runtime.", 
displayName = "Disabled"),
                     @YamlProperty(name = "faultToleranceConfiguration", type = 
"object:org.apache.camel.model.FaultToleranceConfigurationDefinition", 
description = "Configures the circuit breaker to use MicroProfile Fault 
Tolerance with the given configuration.", displayName = "Fault Tolerance 
Configuration"),
                     @YamlProperty(name = "id", type = "string", description = 
"Sets the id of this node", displayName = "Id"),
-                    @YamlProperty(name = "inheritErrorHandler", type = 
"boolean", description = "To turn on or off Camel error handling during circuit 
breaker (only failover load balancer is supported).", displayName = "Inherit 
Error Handler"),
+                    @YamlProperty(name = "inheritErrorHandler", type = 
"boolean", description = "To turn on or off Camel error handling during circuit 
breaker. If this is enabled then Camel error handler will first trigger if 
there is an error in the circuit breaker, which allows to let Camel handle 
redeliveries. If all attempts is failed, then after the circuit breaker is 
finished, then Camel error handler can handle the error as well such as the 
dead letter channel. By default, Camel e [...]
                     @YamlProperty(name = "onFallback", type = 
"object:org.apache.camel.model.OnFallbackDefinition", description = "The 
fallback route path to execute that does not go over the network. This should 
be a static or cached result that can immediately be returned upon failure. If 
the fallback requires network connection then use onFallbackViaNetwork() .", 
displayName = "On Fallback"),
                     @YamlProperty(name = "resilience4jConfiguration", type = 
"object:org.apache.camel.model.Resilience4jConfigurationDefinition", 
description = "Configures the circuit breaker to use Resilience4j with the 
given configuration.", displayName = "Resilience4j Configuration"),
                     @YamlProperty(name = "steps", type = 
"array:org.apache.camel.model.ProcessorDefinition")

Reply via email to