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 2019/11/18 09:00:50 UTC

[camel] 08/23: CAMEL-13691: camel-resilience4j - WIP

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

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

commit 1cd632f17774dd7c72c86df4d75ce3c9d18ff571
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sun Nov 17 09:10:01 2019 +0100

    CAMEL-13691: camel-resilience4j - WIP
---
 .../component/resilience4j/ResilienceReifier.java  |  1 +
 .../HystrixRouteConfigMaximumSizeTest.java         | 86 ----------------------
 .../resilience4j/HystrixRouteConfigTest.java       | 85 ---------------------
 ...java => ResilienceInheritErrorHandlerTest.java} |  6 +-
 .../SpringHystrixRouteConfigMaximumSizeTest.java   | 44 -----------
 .../SpringHystrixRouteConfigRefTest.java           | 44 -----------
 .../resilience4j/SpringHystrixRouteConfigTest.java | 44 -----------
 .../SpringHystrixRouteConfigMaximumSizeTest.xml    | 49 ------------
 .../SpringHystrixRouteConfigRefTest.xml            | 51 -------------
 .../resilience4j/SpringHystrixRouteConfigTest.xml  | 49 ------------
 .../camel-main-configuration-metadata.json         | 84 +++++++++++++++++++++
 11 files changed, 87 insertions(+), 456 deletions(-)

diff --git a/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceReifier.java b/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceReifier.java
index 912fb3e..a9b3d00 100644
--- a/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceReifier.java
+++ b/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceReifier.java
@@ -48,6 +48,7 @@ public class ResilienceReifier extends ProcessorReifier<CircuitBreakerDefinition
     // TODO: thread pool bulkhead
     // TODO: spring-boot allow to configure via resilience4j-spring-boot
     // TODO: example
+    // TODO: camel-main - configure hystrix/resilience/rest via java code fluent builder (does it work)
 
     public ResilienceReifier(CircuitBreakerDefinition definition) {
         super(definition);
diff --git a/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/HystrixRouteConfigMaximumSizeTest.java b/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/HystrixRouteConfigMaximumSizeTest.java
deleted file mode 100644
index cc225fe..0000000
--- a/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/HystrixRouteConfigMaximumSizeTest.java
+++ /dev/null
@@ -1,86 +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.component.resilience4j;
-
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.model.CircuitBreakerDefinition;
-import org.apache.camel.model.HystrixConfigurationDefinition;
-import org.apache.camel.model.RouteDefinition;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Ignore;
-import org.junit.Test;
-
-@Ignore
-public class HystrixRouteConfigMaximumSizeTest extends CamelTestSupport {
-
-    @Test
-    public void testHystrix() throws Exception {
-        getMockEndpoint("mock:result").expectedBodiesReceived("Bye World");
-
-        template.sendBody("direct:start", "Hello World");
-
-        assertMockEndpointsSatisfied();
-    }
-    
-    @Test
-    public void testGroupKeyAndThreadPoolKeyConfigFlagsDoNotScrapHystrixConfiguration() throws Exception {
-        // dummy route
-        RouteBuilder rb = new RouteBuilder(context) {
-            @Override
-            public void configure() throws Exception {
-                from("direct:foo")
-                    .circuitBreaker()
-                        .hystrixConfiguration().groupKey("test2").metricsHealthSnapshotIntervalInMilliseconds(99999).end()
-                        .to("log:hello")
-                    .end();
-                
-            }
-        };
-        
-        rb.configure();
-        
-        RouteDefinition route = rb.getRouteCollection().getRoutes().get(0);
-        assertEquals(CircuitBreakerDefinition.class, route.getOutputs().get(0).getClass());
-        
-        HystrixConfigurationDefinition config = ((CircuitBreakerDefinition) route.getOutputs().get(0)).getHystrixConfiguration();
-        assertEquals("test2", config.getGroupKey());
-        assertEquals(99999, config.getMetricsHealthSnapshotIntervalInMilliseconds().intValue());
-    }
-    
-    @Override
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            @Override
-            public void configure() throws Exception {
-                from("direct:start")
-                    .circuitBreaker()
-                        .hystrixConfiguration().groupKey("myCamelApp").requestLogEnabled(false).corePoolSize(5)
-                            .maximumSize(15).allowMaximumSizeToDivergeFromCoreSize(true)
-                        .end()
-                        .to("direct:foo")
-                    .onFallback()
-                        .transform().constant("Fallback message")
-                    .end()
-                    .to("mock:result");
-
-                from("direct:foo")
-                    .transform().constant("Bye World");
-            }
-        };
-    }
-
-}
diff --git a/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/HystrixRouteConfigTest.java b/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/HystrixRouteConfigTest.java
deleted file mode 100644
index dc47a32..0000000
--- a/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/HystrixRouteConfigTest.java
+++ /dev/null
@@ -1,85 +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.component.resilience4j;
-
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.model.CircuitBreakerDefinition;
-import org.apache.camel.model.HystrixConfigurationDefinition;
-import org.apache.camel.model.RouteDefinition;
-import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Ignore;
-import org.junit.Test;
-
-@Ignore
-public class HystrixRouteConfigTest extends CamelTestSupport {
-
-    @Test
-    public void testHystrix() throws Exception {
-        getMockEndpoint("mock:result").expectedBodiesReceived("Bye World");
-
-        template.sendBody("direct:start", "Hello World");
-
-        assertMockEndpointsSatisfied();
-    }
-    
-    @Test
-    public void testGroupKeyAndThreadPoolKeyConfigFlagsDoNotScrapHystrixConfiguration() throws Exception {
-        // dummy route
-        RouteBuilder rb = new RouteBuilder(context) {
-            @Override
-            public void configure() throws Exception {
-                from("direct:foo")
-                    .circuitBreaker()
-                        .hystrixConfiguration().groupKey("test2").metricsHealthSnapshotIntervalInMilliseconds(99999).end()
-                        .to("log:hello")
-                    .end();
-                
-            }
-        };
-        
-        rb.configure();
-        
-        RouteDefinition route = rb.getRouteCollection().getRoutes().get(0);
-        assertEquals(CircuitBreakerDefinition.class, route.getOutputs().get(0).getClass());
-        
-        HystrixConfigurationDefinition config = ((CircuitBreakerDefinition) route.getOutputs().get(0)).getHystrixConfiguration();
-        assertEquals("test2", config.getGroupKey());
-        assertEquals(99999, config.getMetricsHealthSnapshotIntervalInMilliseconds().intValue());
-    }
-
-    
-    @Override
-    protected RouteBuilder createRouteBuilder() throws Exception {
-        return new RouteBuilder() {
-            @Override
-            public void configure() throws Exception {
-                from("direct:start")
-                    .circuitBreaker()
-                        .hystrixConfiguration().groupKey("myCamelApp").requestLogEnabled(false).corePoolSize(5).end()
-                        .to("direct:foo")
-                    .onFallback()
-                        .transform().constant("Fallback message")
-                    .end()
-                    .to("mock:result");
-
-                from("direct:foo")
-                    .transform().constant("Bye World");
-            }
-        };
-    }
-
-}
diff --git a/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/HystrixInheritErrorHandlerTest.java b/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/ResilienceInheritErrorHandlerTest.java
similarity index 93%
rename from components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/HystrixInheritErrorHandlerTest.java
rename to components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/ResilienceInheritErrorHandlerTest.java
index d50e02d..0974ce4 100644
--- a/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/HystrixInheritErrorHandlerTest.java
+++ b/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/ResilienceInheritErrorHandlerTest.java
@@ -18,14 +18,12 @@ package org.apache.camel.component.resilience4j;
 
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.test.junit4.CamelTestSupport;
-import org.junit.Ignore;
 import org.junit.Test;
 
-@Ignore
-public class HystrixInheritErrorHandlerTest extends CamelTestSupport {
+public class ResilienceInheritErrorHandlerTest extends CamelTestSupport {
 
     @Test
-    public void testHystrix() throws Exception {
+    public void testResilience() throws Exception {
         getMockEndpoint("mock:a").expectedMessageCount(3 + 1);
         getMockEndpoint("mock:dead").expectedMessageCount(1);
         getMockEndpoint("mock:result").expectedMessageCount(0);
diff --git a/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/SpringHystrixRouteConfigMaximumSizeTest.java b/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/SpringHystrixRouteConfigMaximumSizeTest.java
deleted file mode 100644
index fabd88a..0000000
--- a/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/SpringHystrixRouteConfigMaximumSizeTest.java
+++ /dev/null
@@ -1,44 +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.component.resilience4j;
-
-import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.springframework.context.support.AbstractApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-import org.springframework.test.annotation.DirtiesContext;
-
-@Ignore
-@DirtiesContext
-public class SpringHystrixRouteConfigMaximumSizeTest extends CamelSpringTestSupport {
-
-    @Override
-    protected AbstractApplicationContext createApplicationContext() {
-        return new ClassPathXmlApplicationContext("org/apache/camel/component/hystrix/processor/SpringHystrixRouteConfigMaximumSizeTest.xml");
-    }
-
-    @Test
-    public void testHystrix() throws Exception {
-        getMockEndpoint("mock:result").expectedBodiesReceived("Bye World");
-
-        template.sendBody("direct:start", "Hello World");
-
-        assertMockEndpointsSatisfied();
-    }
-
-}
diff --git a/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/SpringHystrixRouteConfigRefTest.java b/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/SpringHystrixRouteConfigRefTest.java
deleted file mode 100644
index 14eaae3..0000000
--- a/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/SpringHystrixRouteConfigRefTest.java
+++ /dev/null
@@ -1,44 +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.component.resilience4j;
-
-import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.springframework.context.support.AbstractApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-import org.springframework.test.annotation.DirtiesContext;
-
-@Ignore
-@DirtiesContext
-public class SpringHystrixRouteConfigRefTest extends CamelSpringTestSupport {
-
-    @Override
-    protected AbstractApplicationContext createApplicationContext() {
-        return new ClassPathXmlApplicationContext("org/apache/camel/component/hystrix/processor/SpringHystrixRouteConfigRefTest.xml");
-    }
-
-    @Test
-    public void testHystrix() throws Exception {
-        getMockEndpoint("mock:result").expectedBodiesReceived("Bye World");
-
-        template.sendBody("direct:start", "Hello World");
-
-        assertMockEndpointsSatisfied();
-    }
-
-}
diff --git a/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/SpringHystrixRouteConfigTest.java b/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/SpringHystrixRouteConfigTest.java
deleted file mode 100644
index 72ec426..0000000
--- a/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/SpringHystrixRouteConfigTest.java
+++ /dev/null
@@ -1,44 +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.component.resilience4j;
-
-import org.apache.camel.test.spring.CamelSpringTestSupport;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.springframework.context.support.AbstractApplicationContext;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-import org.springframework.test.annotation.DirtiesContext;
-
-@Ignore
-@DirtiesContext
-public class SpringHystrixRouteConfigTest extends CamelSpringTestSupport {
-
-    @Override
-    protected AbstractApplicationContext createApplicationContext() {
-        return new ClassPathXmlApplicationContext("org/apache/camel/component/hystrix/processor/SpringHystrixRouteConfigTest.xml");
-    }
-
-    @Test
-    public void testHystrix() throws Exception {
-        getMockEndpoint("mock:result").expectedBodiesReceived("Bye World");
-
-        template.sendBody("direct:start", "Hello World");
-
-        assertMockEndpointsSatisfied();
-    }
-
-}
diff --git a/components/camel-resilience4j/src/test/resources/org/apache/camel/component/resilience4j/SpringHystrixRouteConfigMaximumSizeTest.xml b/components/camel-resilience4j/src/test/resources/org/apache/camel/component/resilience4j/SpringHystrixRouteConfigMaximumSizeTest.xml
deleted file mode 100644
index 4d0aa78..0000000
--- a/components/camel-resilience4j/src/test/resources/org/apache/camel/component/resilience4j/SpringHystrixRouteConfigMaximumSizeTest.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    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.
-
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="
-		http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
-		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">
-
-  <camelContext xmlns="http://camel.apache.org/schema/spring">
-    <route>
-      <from uri="direct:start"/>
-      <circuitBreaker>
-        <hystrixConfiguration groupKey="myCamelApp" requestLogEnabled="false" corePoolSize="5" maximumSize="15" allowMaximumSizeToDivergeFromCoreSize="true"/>
-        <to uri="direct:foo"/>
-        <onFallback>
-          <transform>
-            <constant>Fallback message</constant>
-          </transform>
-        </onFallback>
-      </circuitBreaker>
-      <to uri="mock:result"/>
-    </route>
-
-    <route>
-      <from uri="direct:foo"/>
-      <transform>
-        <constant>Bye World</constant>
-      </transform>
-    </route>
-  </camelContext>
-
-</beans>
\ No newline at end of file
diff --git a/components/camel-resilience4j/src/test/resources/org/apache/camel/component/resilience4j/SpringHystrixRouteConfigRefTest.xml b/components/camel-resilience4j/src/test/resources/org/apache/camel/component/resilience4j/SpringHystrixRouteConfigRefTest.xml
deleted file mode 100644
index 40cdf25..0000000
--- a/components/camel-resilience4j/src/test/resources/org/apache/camel/component/resilience4j/SpringHystrixRouteConfigRefTest.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    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.
-
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="
-		http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
-		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">
-
-  <camelContext xmlns="http://camel.apache.org/schema/spring">
-
-    <hystrixConfiguration id="hysConfig" requestLogEnabled="false" corePoolSize="5"/>
-
-    <route>
-      <from uri="direct:start"/>
-      <circuitBreaker configurationRef="hysConfig">
-        <to uri="direct:foo"/>
-        <onFallback>
-          <transform>
-            <constant>Fallback message</constant>
-          </transform>
-        </onFallback>
-      </circuitBreaker>
-      <to uri="mock:result"/>
-    </route>
-
-    <route>
-      <from uri="direct:foo"/>
-      <transform>
-        <constant>Bye World</constant>
-      </transform>
-    </route>
-  </camelContext>
-
-</beans>
\ No newline at end of file
diff --git a/components/camel-resilience4j/src/test/resources/org/apache/camel/component/resilience4j/SpringHystrixRouteConfigTest.xml b/components/camel-resilience4j/src/test/resources/org/apache/camel/component/resilience4j/SpringHystrixRouteConfigTest.xml
deleted file mode 100644
index 2c8a9a6..0000000
--- a/components/camel-resilience4j/src/test/resources/org/apache/camel/component/resilience4j/SpringHystrixRouteConfigTest.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    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.
-
--->
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="
-		http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
-		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd ">
-
-  <camelContext xmlns="http://camel.apache.org/schema/spring">
-    <route>
-      <from uri="direct:start"/>
-      <circuitBreaker>
-        <hystrixConfiguration groupKey="myCamelApp" requestLogEnabled="false" corePoolSize="5"/>
-        <to uri="direct:foo"/>
-        <onFallback>
-          <transform>
-            <constant>Fallback message</constant>
-          </transform>
-        </onFallback>
-      </circuitBreaker>
-      <to uri="mock:result"/>
-    </route>
-
-    <route>
-      <from uri="direct:foo"/>
-      <transform>
-        <constant>Bye World</constant>
-      </transform>
-    </route>
-  </camelContext>
-
-</beans>
\ No newline at end of file
diff --git a/core/camel-main/src/main/resources/META-INF/camel-main-configuration-metadata.json b/core/camel-main/src/main/resources/META-INF/camel-main-configuration-metadata.json
index 84b2444..0713982 100644
--- a/core/camel-main/src/main/resources/META-INF/camel-main-configuration-metadata.json
+++ b/core/camel-main/src/main/resources/META-INF/camel-main-configuration-metadata.json
@@ -52,6 +52,12 @@
 			"defaultValue":"true"
 		},
 		{
+			"name":"camel.main.automatic-transition-from-open-to-half-open-enabled",
+			"type":"java.lang.Boolean",
+			"sourceType":"org.apache.camel.main.Resilience4jConfigurationProperties",
+			"description":"Enables automatic transition from OPEN to HALF_OPEN state once the waitDurationInOpenState has passed."
+		},
+		{
 			"name":"camel.main.auto-startup",
 			"type":"boolean",
 			"sourceType":"org.apache.camel.main.DefaultConfigurationProperties",
@@ -103,6 +109,30 @@
 			"description":"Sets the logging level used by bean introspection, logging activity of its usage. The default is TRACE."
 		},
 		{
+			"name":"camel.main.bulkhead-enabled",
+			"type":"java.lang.Boolean",
+			"sourceType":"org.apache.camel.main.Resilience4jConfigurationProperties",
+			"description":"Whether bulkhead is enabled or not on the circuit breaker."
+		},
+		{
+			"name":"camel.main.bulkhead-max-concurrent-calls",
+			"type":"java.lang.Integer",
+			"sourceType":"org.apache.camel.main.Resilience4jConfigurationProperties",
+			"description":"Configures the max amount of concurrent calls the bulkhead will support."
+		},
+		{
+			"name":"camel.main.bulkhead-max-wait-duration",
+			"type":"java.lang.Integer",
+			"sourceType":"org.apache.camel.main.Resilience4jConfigurationProperties",
+			"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 a ne [...]
+		},
+		{
+			"name":"camel.main.config-ref",
+			"type":"java.lang.String",
+			"sourceType":"org.apache.camel.main.Resilience4jConfigurationProperties",
+			"description":"Refers to an existing io.github.resilience4j.circuitbreaker.CircuitBreakerConfig instance to lookup and use from the registry."
+		},
+		{
 			"name":"camel.main.consumer-template-cache-size",
 			"type":"int",
 			"sourceType":"org.apache.camel.main.DefaultConfigurationProperties",
@@ -158,6 +188,12 @@
 			"description":"Sets whether endpoint runtime statistics is enabled (gathers runtime usage of each incoming and outgoing endpoints). The default value is false."
 		},
 		{
+			"name":"camel.main.failure-rate-threshold",
+			"type":"java.lang.Float",
+			"sourceType":"org.apache.camel.main.Resilience4jConfigurationProperties",
+			"description":"Configures the failure rate threshold in percentage. If the failure rate is equal or greater than the threshold the CircuitBreaker transitions to open and starts short-circuiting calls. The threshold must be greater than 0 and not greater than 100. Default value is 50 percentage."
+		},
+		{
 			"name":"camel.main.file-configurations",
 			"type":"java.lang.String",
 			"sourceType":"org.apache.camel.main.DefaultConfigurationProperties",
@@ -248,6 +284,12 @@
 			"defaultValue":"true"
 		},
 		{
+			"name":"camel.main.minimum-number-of-calls",
+			"type":"java.lang.Integer",
+			"sourceType":"org.apache.camel.main.Resilience4jConfigurationProperties",
+			"description":"Configures configures the minimum number of calls which are required (per sliding window period) before the CircuitBreaker can calculate the error rate. For example, if minimumNumberOfCalls is 10, then at least 10 calls must be recorded, before the failure rate can be calculated. If only 9 calls have been recorded the CircuitBreaker will not transition to open even if all 9 calls have failed. Default minimumNumberOfCalls is 100"
+		},
+		{
 			"name":"camel.main.name",
 			"type":"java.lang.String",
 			"sourceType":"org.apache.camel.main.DefaultConfigurationProperties",
@@ -260,6 +302,12 @@
 			"description":"Sets package names for scanning for org.apache.camel.builder.RouteBuilder classes as candidates to be included. If you are using Spring Boot then its instead recommended to use Spring Boots component scanning and annotate your route builder classes with Component. In other words only use this for Camel Main in standalone mode."
 		},
 		{
+			"name":"camel.main.permitted-number-of-calls-in-half-open-state",
+			"type":"java.lang.Integer",
+			"sourceType":"org.apache.camel.main.Resilience4jConfigurationProperties",
+			"description":"Configures the number of permitted calls when the CircuitBreaker is half open. The size must be greater than 0. Default size is 10."
+		},
+		{
 			"name":"camel.main.producer-template-cache-size",
 			"type":"int",
 			"sourceType":"org.apache.camel.main.DefaultConfigurationProperties",
@@ -320,6 +368,30 @@
 			"defaultValue":"300"
 		},
 		{
+			"name":"camel.main.sliding-window-size",
+			"type":"java.lang.Integer",
+			"sourceType":"org.apache.camel.main.Resilience4jConfigurationProperties",
+			"description":"Configures the size of the sliding window which is used to record the outcome of calls when the CircuitBreaker is closed. slidingWindowSize configures the size of the sliding window. Sliding window can either be count-based or time-based. If slidingWindowType is COUNT_BASED, the last slidingWindowSize calls are recorded and aggregated. If slidingWindowType is TIME_BASED, the calls of the last slidingWindowSize seconds are recorded and aggregated. The slidingWindowSize m [...]
+		},
+		{
+			"name":"camel.main.sliding-window-type",
+			"type":"java.lang.String",
+			"sourceType":"org.apache.camel.main.Resilience4jConfigurationProperties",
+			"description":"Configures the type of the sliding window which is used to record the outcome of calls when the CircuitBreaker is closed. Sliding window can either be count-based or time-based. If slidingWindowType is COUNT_BASED, the last slidingWindowSize calls are recorded and aggregated. If slidingWindowType is TIME_BASED, the calls of the last slidingWindowSize seconds are recorded and aggregated. Default slidingWindowType is COUNT_BASED."
+		},
+		{
+			"name":"camel.main.slow-call-duration-threshold",
+			"type":"java.lang.Integer",
+			"sourceType":"org.apache.camel.main.Resilience4jConfigurationProperties",
+			"description":"Configures the duration threshold (seconds) above which calls are considered as slow and increase the slow calls percentage. Default value is 60 seconds."
+		},
+		{
+			"name":"camel.main.slow-call-rate-threshold",
+			"type":"java.lang.Float",
+			"sourceType":"org.apache.camel.main.Resilience4jConfigurationProperties",
+			"description":"Configures a threshold in percentage. The CircuitBreaker considers a call as slow when the call duration is greater than slowCallDurationThreshold(Duration. When the percentage of slow calls is equal or greater the threshold, the CircuitBreaker transitions to open and starts short-circuiting calls. The threshold must be greater than 0 and not greater than 100. Default value is 100 percentage which means that all recorded calls must be slower than slowCallDurationThreshold."
+		},
+		{
 			"name":"camel.main.stream-caching-any-spool-rules",
 			"type":"boolean",
 			"sourceType":"org.apache.camel.main.DefaultConfigurationProperties",
@@ -417,6 +489,18 @@
 			"description":"To turn on MDC logging"
 		},
 		{
+			"name":"camel.main.wait-duration-in-open-state",
+			"type":"java.lang.Integer",
+			"sourceType":"org.apache.camel.main.Resilience4jConfigurationProperties",
+			"description":"Configures the wait duration (in seconds) which specifies how long the CircuitBreaker should stay open, before it switches to half open. Default value is 60 seconds."
+		},
+		{
+			"name":"camel.main.writable-stack-trace-enabled",
+			"type":"java.lang.Boolean",
+			"sourceType":"org.apache.camel.main.Resilience4jConfigurationProperties",
+			"description":"Enables writable stack traces. When set to false, Exception.getStackTrace returns a zero length array. This may be used to reduce log spam when the circuit breaker is open as the cause of the exceptions is already known (the circuit breaker is short-circuiting calls)."
+		},
+		{
 			"name":"camel.main.xml-rests",
 			"type":"java.lang.String",
 			"sourceType":"org.apache.camel.main.DefaultConfigurationProperties",