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 c24222f1f50d CAMEL-27212: camel-resilience4j - a timeout fires while
the calls block the thread pool, and a restarted route can use its thread pool
(#30459)
c24222f1f50d is described below
commit c24222f1f50d12beac273342a82b9aea17e29d8d
Author: allthingssecurity <[email protected]>
AuthorDate: Fri Nov 20 18:19:20 2026 +0530
CAMEL-27212: camel-resilience4j - a timeout fires while the calls block the
thread pool, and a restarted route can use its thread pool (#30459)
In asynchronous mode the processor scheduled the timeouts of the
TimeLimiter on the
thread pool that runs the calls. When the calls block every thread of that
pool (a
synchronous call to a server that does not answer), no timeout could fire:
no call
timed out, no fallback ran and the circuit breaker never opened. The
timeouts now run
on a scheduled thread pool of their own.
The thread pool that runs the calls is created once, with the route, but
doStop shut
it down, so after a route stop and start no call with a timeout ran: the
pool discarded
the task, so the call timed out without running, or in asynchronous mode
(where the
timeout was discarded too) never completed. The thread pools are now
shut down when the route is removed (doShutdown).
CAMEL-27212: camel-resilience4j - doc caveat for the fallback after a
timeout, upgrade guide and thread pool lifecycle test
Review follow-up.
- resilience4j-eip.adoc (and its catalog copy): after a timeout the fallback
and the rest of the route run on a CircuitBreakerTimeout thread (default
thread pool profile, 10 threads), so keep the fallback non-blocking or
give
that thread pool enough threads.
- Upgrade guide entry: the extra CircuitBreakerTimeout thread pool, a
timeoutExecutorService runs only the calls, the continuation after a
timeout
runs on the new thread, and the thread pools stay until the route is
removed.
- ResilienceThreadPoolLifecycleTest: the thread pools of a sync and an async
circuit breaker with a timeout are not shut down by stopRoute, and are
shut
down by removeRoute.
CAMEL-27212: camel-resilience4j - name the route lifecycle change in the
upgrade guide heading
The heading named only the asynchronous timeout change, but a stopped route
keeping its thread pools applies to synchronous Circuit Breakers too.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
.../camel/catalog/docs/resilience4j-eip.adoc | 8 ++
.../resilience4j/ResilienceProcessor.java | 25 ++++-
.../component/resilience4j/ResilienceReifier.java | 4 +-
.../ResilienceAsyncTimeoutBlockedPoolTest.java | 85 +++++++++++++++
.../resilience4j/ResilienceRouteRestartTest.java | 81 ++++++++++++++
.../ResilienceThreadPoolLifecycleTest.java | 118 +++++++++++++++++++++
.../docs/modules/eips/pages/resilience4j-eip.adoc | 8 ++
.../ROOT/pages/camel-4x-upgrade-guide-4_24.adoc | 18 ++++
8 files changed, 339 insertions(+), 8 deletions(-)
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/resilience4j-eip.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/resilience4j-eip.adoc
index 51362d372585..5729c020889d 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/resilience4j-eip.adoc
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/resilience4j-eip.adoc
@@ -234,6 +234,14 @@ NOTE: When using asynchronous mode with timeout, the
`timeoutExecutorService` mu
a `ScheduledExecutorService`. If not provided, Camel will automatically create
one.
If a custom executor is provided that is not a `ScheduledExecutorService`, the
route will
fail to start with an `IllegalArgumentException`.
+The calls run on this thread pool, and the timeouts on threads of their own,
so a timeout
+fires also when every thread of the pool is blocked in a call. The fallback,
and the rest of the
+route after the Circuit Breaker, then run on the thread of the timeout. These
threads come from a
+scheduled thread pool of the Circuit Breaker, named `CircuitBreakerTimeout`,
that has the size of the
+default thread pool profile (10 threads, set with `camel.threadpool.poolSize`,
which other thread pools
+use too). Keep the fallback, and the steps after the Circuit Breaker,
non-blocking, or give that thread
+pool enough threads: each exchange that timed out and whose fallback blocks
(such as a call to a backup
+HTTP service) holds a timeout thread, and while all of them are held, the next
timeouts wait.
=== Camel's Error Handler and Circuit Breaker EIP
diff --git
a/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceProcessor.java
b/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceProcessor.java
index c8dcdc38ff72..bb6b6f5f0ba9 100644
---
a/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceProcessor.java
+++
b/components/camel-resilience4j/src/main/java/org/apache/camel/component/resilience4j/ResilienceProcessor.java
@@ -109,6 +109,8 @@ public class ResilienceProcessor extends
BaseProcessorSupport
private boolean shutdownExecutorService;
private ExecutorService executorService;
private ScheduledExecutorService scheduledExecutorService;
+ // the scheduler of the timeouts in asynchronous mode, when created by
this processor
+ private ScheduledExecutorService timeoutScheduler;
private ProcessorExchangeFactory processorExchangeFactory;
private PooledExchangeTaskFactory taskFactory;
private PooledExchangeTaskFactory fallbackTaskFactory;
@@ -187,6 +189,12 @@ public class ResilienceProcessor extends
BaseProcessorSupport
if (bulkheadConfig != null) {
bulkhead = bulkheadRegistry.bulkhead(id, bulkheadConfig);
}
+ if (asynchronous && timeLimiter != null && scheduledExecutorService ==
null && timeoutScheduler == null) {
+ // the timeouts get their own threads: when they were tasks of the
pool that runs the calls, a timeout
+ // could not fire while every thread of that pool was blocked in a
call, which is what the timeout is for
+ timeoutScheduler =
camelContext.getExecutorServiceManager().newDefaultScheduledThreadPool(this,
+ "CircuitBreakerTimeout");
+ }
ServiceHelper.startService(processorExchangeFactory, taskFactory,
fallbackTaskFactory, processor);
}
@@ -202,10 +210,8 @@ public class ResilienceProcessor extends
BaseProcessorSupport
@Override
protected void doStop() throws Exception {
- if (shutdownExecutorService && executorService != null) {
-
getCamelContext().getExecutorServiceManager().shutdownNow(executorService);
- }
-
+ // the thread pools are shut down when the route is removed
(doShutdown), and not here: the thread pool that
+ // runs the calls is created once, with the route, and a route that is
stopped is started again with it
ServiceHelper.stopService(processorExchangeFactory, taskFactory,
fallbackTaskFactory, processor);
if (createCircuitBreaker) {
@@ -222,6 +228,13 @@ public class ResilienceProcessor extends
BaseProcessorSupport
@Override
protected void doShutdown() throws Exception {
+ if (shutdownExecutorService && executorService != null) {
+
getCamelContext().getExecutorServiceManager().shutdownNow(executorService);
+ }
+ if (timeoutScheduler != null) {
+
getCamelContext().getExecutorServiceManager().shutdownNow(timeoutScheduler);
+ timeoutScheduler = null;
+ }
ServiceHelper.stopAndShutdownServices(processorExchangeFactory,
taskFactory, fallbackTaskFactory, processor);
}
@@ -688,7 +701,9 @@ public class ResilienceProcessor extends
BaseProcessorSupport
supplier = Bulkhead.decorateCompletionStage(bulkhead,
supplier);
}
if (timeLimiter != null) {
- supplier = TimeLimiter.decorateCompletionStage(timeLimiter,
scheduledExecutorService, supplier);
+ ScheduledExecutorService scheduler
+ = scheduledExecutorService != null ?
scheduledExecutorService : timeoutScheduler;
+ supplier = TimeLimiter.decorateCompletionStage(timeLimiter,
scheduler, supplier);
}
supplier = CircuitBreaker.decorateCompletionStage(circuitBreaker,
supplier);
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 d0b05fa9d175..4b68a3bac165 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
@@ -253,10 +253,8 @@ public class ResilienceReifier extends
ProcessorReifier<CircuitBreakerDefinition
shutdownThreadPool = true;
}
+ // the thread pool runs the calls; in asynchronous mode the processor
schedules the timeouts on its own threads
processor.setExecutorService(executorService);
- if (isAsync && executorService instanceof ScheduledExecutorService
ses) {
- processor.setScheduledExecutorService(ses);
- }
processor.setShutdownExecutorService(shutdownThreadPool);
}
diff --git
a/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/ResilienceAsyncTimeoutBlockedPoolTest.java
b/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/ResilienceAsyncTimeoutBlockedPoolTest.java
new file mode 100644
index 000000000000..844287e462b9
--- /dev/null
+++
b/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/ResilienceAsyncTimeoutBlockedPoolTest.java
@@ -0,0 +1,85 @@
+/*
+ * 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 java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.test.junit6.CamelTestSupport;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * In asynchronous mode the timeout must fire also when every thread of the
pool that runs the calls is blocked in a
+ * call: that is the case the timeout is for.
+ */
+public class ResilienceAsyncTimeoutBlockedPoolTest extends CamelTestSupport {
+
+ private final CountDownLatch release = new CountDownLatch(1);
+ private final ScheduledExecutorService pool =
Executors.newScheduledThreadPool(1);
+
+ @Override
+ protected CamelContext createCamelContext() throws Exception {
+ CamelContext ctx = super.createCamelContext();
+ // a pool with one thread, so a single blocked call takes every thread
of the pool
+ ctx.getRegistry().bind("cbPool", pool);
+ return ctx;
+ }
+
+ @AfterEach
+ void releaseBlockedCalls() {
+ release.countDown();
+ pool.shutdownNow();
+ }
+
+ @Test
+ public void testTimeoutWhenThePoolIsBlocked() throws Exception {
+ Future<Object> reply = template.asyncRequestBody("direct:start",
"Hello");
+
+ // the call blocks its thread (as a synchronous http call to a server
that does not answer does), and the
+ // timeout of 200 millis must give the fallback, without waiting for
the call
+ assertEquals("Fallback", reply.get(5, TimeUnit.SECONDS));
+ }
+
+ @Override
+ protected RoutesBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:start")
+ .circuitBreaker()
+ .resilience4jConfiguration()
+
.asynchronous(true).timeoutEnabled(true).timeoutDuration(200)
+ .timeoutExecutorService("cbPool")
+ .end()
+ .process(e -> release.await(10, TimeUnit.SECONDS))
+ .setBody(constant("Bye World"))
+ .onFallback()
+ .transform().constant("Fallback")
+ .end();
+ }
+ };
+ }
+}
diff --git
a/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/ResilienceRouteRestartTest.java
b/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/ResilienceRouteRestartTest.java
new file mode 100644
index 000000000000..5ddf4bee511a
--- /dev/null
+++
b/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/ResilienceRouteRestartTest.java
@@ -0,0 +1,81 @@
+/*
+ * 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 java.util.concurrent.TimeUnit;
+
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.test.junit6.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+/**
+ * A circuit breaker with a timeout must still call its steps after its route
is stopped and started again.
+ */
+public class ResilienceRouteRestartTest extends CamelTestSupport {
+
+ @Test
+ public void testSyncAfterRestart() throws Exception {
+ assertEquals("Bye World", request("direct:sync"));
+
+ context.getRouteController().stopRoute("sync");
+ context.getRouteController().startRoute("sync");
+
+ assertEquals("Bye World", request("direct:sync"));
+ }
+
+ @Test
+ public void testAsyncAfterRestart() throws Exception {
+ assertEquals("Bye World", request("direct:async"));
+
+ context.getRouteController().stopRoute("async");
+ context.getRouteController().startRoute("async");
+
+ assertEquals("Bye World", request("direct:async"));
+ }
+
+ private Object request(String uri) throws Exception {
+ // on a thread of the template, so a call that never completes fails
the test instead of blocking it
+ return template.asyncRequestBody(uri, "Hello").get(10,
TimeUnit.SECONDS);
+ }
+
+ @Override
+ protected RoutesBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:sync").routeId("sync")
+ .circuitBreaker()
+
.resilience4jConfiguration().timeoutEnabled(true).timeoutDuration(2000).end()
+ .setBody(constant("Bye World"))
+ .onFallback()
+ .transform().constant("Fallback")
+ .end();
+
+ from("direct:async").routeId("async")
+ .circuitBreaker()
+
.resilience4jConfiguration().asynchronous(true).timeoutEnabled(true).timeoutDuration(2000).end()
+ .setBody(constant("Bye World"))
+ .onFallback()
+ .transform().constant("Fallback")
+ .end();
+ }
+ };
+ }
+}
diff --git
a/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/ResilienceThreadPoolLifecycleTest.java
b/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/ResilienceThreadPoolLifecycleTest.java
new file mode 100644
index 000000000000..5c9cad79f976
--- /dev/null
+++
b/components/camel-resilience4j/src/test/java/org/apache/camel/component/resilience4j/ResilienceThreadPoolLifecycleTest.java
@@ -0,0 +1,118 @@
+/*
+ * 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 java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.impl.engine.DefaultExecutorServiceManager;
+import org.apache.camel.spi.ThreadPoolProfile;
+import org.apache.camel.test.junit6.CamelTestSupport;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+/**
+ * The thread pools that Camel creates for a circuit breaker with a timeout
live as long as its route: a stopped route
+ * is started again with them, so stopping the route must not shut them down,
and removing the route must.
+ */
+class ResilienceThreadPoolLifecycleTest extends CamelTestSupport {
+
+ /** The scheduled thread pools created by name: the calls and the timeouts
of the asynchronous mode. */
+ private final Map<String, ScheduledExecutorService> scheduledPools = new
ConcurrentHashMap<>();
+ /** The thread pools created by name: the calls of the synchronous mode. */
+ private final Map<String, ExecutorService> pools = new
ConcurrentHashMap<>();
+
+ @Override
+ protected CamelContext createCamelContext() throws Exception {
+ CamelContext context = super.createCamelContext();
+ context.setExecutorServiceManager(new
DefaultExecutorServiceManager(context) {
+ @Override
+ public ScheduledExecutorService
newDefaultScheduledThreadPool(Object source, String name) {
+ ScheduledExecutorService answer =
super.newDefaultScheduledThreadPool(source, name);
+ scheduledPools.put(name, answer);
+ return answer;
+ }
+
+ @Override
+ public ExecutorService newThreadPool(Object source, String name,
ThreadPoolProfile profile) {
+ ExecutorService answer = super.newThreadPool(source, name,
profile);
+ pools.put(name, answer);
+ return answer;
+ }
+ });
+ return context;
+ }
+
+ @Test
+ void testThreadPoolsAreShutDownWhenTheRouteIsRemoved() throws Exception {
+ assertEquals("Bye World", request("direct:async"));
+ assertEquals("Bye World", request("direct:sync"));
+ ExecutorService asyncCalls = scheduledPools.get("CircuitBreaker");
+ ExecutorService syncCalls = pools.get("CircuitBreaker");
+ assertNotNull(asyncCalls);
+ assertNotNull(syncCalls);
+
+ context.getRouteController().stopRoute("async");
+ context.getRouteController().stopRoute("sync");
+ assertFalse(asyncCalls.isShutdown(), "the route is started again with
this thread pool");
+ assertFalse(syncCalls.isShutdown(), "the route is started again with
this thread pool");
+ ExecutorService timeouts = scheduledPools.get("CircuitBreakerTimeout");
+ assertNotNull(timeouts);
+ assertFalse(timeouts.isShutdown(), "the route is started again with
this thread pool");
+
+ context.removeRoute("async");
+ context.removeRoute("sync");
+ assertTrue(asyncCalls.isShutdown());
+ assertTrue(syncCalls.isShutdown());
+ assertTrue(timeouts.isShutdown());
+ }
+
+ private Object request(String uri) throws Exception {
+ // on a thread of the template, so a call that never completes fails
the test instead of blocking it
+ return template.asyncRequestBody(uri, "Hello").get(10,
TimeUnit.SECONDS);
+ }
+
+ @Override
+ protected RoutesBuilder createRouteBuilder() {
+ return new RouteBuilder() {
+ @Override
+ public void configure() {
+ from("direct:sync").routeId("sync")
+ .circuitBreaker()
+
.resilience4jConfiguration().timeoutEnabled(true).timeoutDuration(2000).end()
+ .setBody(constant("Bye World"))
+ .end();
+
+ from("direct:async").routeId("async")
+ .circuitBreaker()
+
.resilience4jConfiguration().asynchronous(true).timeoutEnabled(true).timeoutDuration(2000).end()
+ .setBody(constant("Bye World"))
+ .end();
+ }
+ };
+ }
+}
diff --git
a/core/camel-core-engine/src/main/docs/modules/eips/pages/resilience4j-eip.adoc
b/core/camel-core-engine/src/main/docs/modules/eips/pages/resilience4j-eip.adoc
index 51362d372585..5729c020889d 100644
---
a/core/camel-core-engine/src/main/docs/modules/eips/pages/resilience4j-eip.adoc
+++
b/core/camel-core-engine/src/main/docs/modules/eips/pages/resilience4j-eip.adoc
@@ -234,6 +234,14 @@ NOTE: When using asynchronous mode with timeout, the
`timeoutExecutorService` mu
a `ScheduledExecutorService`. If not provided, Camel will automatically create
one.
If a custom executor is provided that is not a `ScheduledExecutorService`, the
route will
fail to start with an `IllegalArgumentException`.
+The calls run on this thread pool, and the timeouts on threads of their own,
so a timeout
+fires also when every thread of the pool is blocked in a call. The fallback,
and the rest of the
+route after the Circuit Breaker, then run on the thread of the timeout. These
threads come from a
+scheduled thread pool of the Circuit Breaker, named `CircuitBreakerTimeout`,
that has the size of the
+default thread pool profile (10 threads, set with `camel.threadpool.poolSize`,
which other thread pools
+use too). Keep the fallback, and the steps after the Circuit Breaker,
non-blocking, or give that thread
+pool enough threads: each exchange that timed out and whose fallback blocks
(such as a call to a backup
+HTTP service) holds a timeout thread, and while all of them are held, the next
timeouts wait.
=== Camel's Error Handler and Circuit Breaker EIP
diff --git
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
index 96026a408d5b..6760655d13f4 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
@@ -2394,6 +2394,24 @@ A failure of the fallback itself is now also caught by
the `doCatch` (before, it
To have those steps use the error handler of the route, move them out of the
`doTry` block.
+=== camel-resilience4j - the timeouts of the asynchronous mode run on a thread
pool of their own, and a stopped route keeps its thread pools
+
+A Circuit Breaker with `asynchronous` and `timeoutEnabled` ran its calls and
its timeouts on the same thread pool, so a
+timeout could not fire while every thread of that pool was blocked in a call.
The thread names and thread counts in
+thread dumps and JMX change:
+
+- Each such Circuit Breaker has one more scheduled thread pool,
`CircuitBreakerTimeout`, that runs the timeouts. It has
+ the size of the default thread pool profile (10 threads by default).
+- A thread pool given with `timeoutExecutorService` now runs only the calls,
not the timeouts. A thread pool that was
+ sized to cover both can be made smaller.
+- After a timeout, the fallback and the rest of the route after the Circuit
Breaker run on a `CircuitBreakerTimeout`
+ thread. Keep them non-blocking, or give that thread pool enough threads (see
the Resilience4j EIP page).
+- A Circuit Breaker with `timeoutEnabled` (asynchronous or not) keeps the
thread pools that Camel created for it while
+ its route is stopped, and shuts them down when the route is removed or the
CamelContext stops. Before, stopping the
+ route shut the thread pool of the calls down, and after the route was
started again, the calls through the Circuit
+ Breaker no longer ran: in synchronous mode each call timed out (into the
fallback, when there is one), and in
+ asynchronous mode the exchange never completed.
+
=== camel-jbang - camel cmd send without a name sends to the integration that
runs
`camel cmd send` without an integration name started a Camel of its own,
without routes, and sent from there. That is