This is an automated email from the ASF dual-hosted git repository.
apupier 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 05d8c5b7d32e Removal of camel-reactive-executor-tomcat
05d8c5b7d32e is described below
commit 05d8c5b7d32e06c7f66b40e095d6ef48de8c9fcb
Author: Aurélien Pupier <[email protected]>
AuthorDate: Wed Aug 26 10:48:01 2026 +0200
Removal of camel-reactive-executor-tomcat
The `camel-reactive-executor-tomcat` component has been deprecated in
4.22. It is now removed.
Its cross-thread `ThreadLocal`
cleanup relied on reflective access to the private `Thread.threadLocals`
field, which is denied by
the JDK module system since JDK 17 and is incompatible with virtual
threads. Without that cleanup,
this executor is functionally identical to the built-in
`DefaultReactiveExecutor`.
To migrate, remove the `camel-reactive-executor-tomcat` dependency from
your project. Camel will
automatically use the default reactive executor.
Signed-off-by: Aurélien Pupier <[email protected]>
---
bom/camel-bom/pom.xml | 5 -
catalog/camel-allcomponents/pom.xml | 5 -
.../org/apache/camel/catalog/docs.properties | 1 -
.../catalog/docs/reactive-executor-tomcat.adoc | 40 ---
.../org/apache/camel/catalog/others.properties | 1 -
.../catalog/others/reactive-executor-tomcat.json | 15 --
components/camel-reactive-executor-tomcat/pom.xml | 66 -----
.../services/org/apache/camel/other.properties | 7 -
.../services/org/apache/camel/reactive-executor | 2 -
.../resources/reactive-executor-tomcat.json | 15 --
.../src/main/docs/reactive-executor-tomcat.adoc | 40 ---
.../reactive/tomcat/TomcatReactiveExecutor.java | 298 ---------------------
.../org/apache/camel/reactive/SimpleMockTest.java | 65 -----
.../src/test/resources/log4j2.properties | 31 ---
components/pom.xml | 1 -
coverage/pom.xml | 5 -
.../examples/json/reactive-executor-tomcat.json | 1 -
docs/components/modules/others/nav.adoc | 1 -
.../others/pages/reactive-executor-tomcat.adoc | 1 -
.../ROOT/pages/camel-4x-upgrade-guide-4_23.adoc | 12 +
parent/pom.xml | 5 -
21 files changed, 12 insertions(+), 605 deletions(-)
diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml
index 22e9c6375f18..aa4e7222ff0d 100644
--- a/bom/camel-bom/pom.xml
+++ b/bom/camel-bom/pom.xml
@@ -2062,11 +2062,6 @@
<artifactId>camel-quickfix</artifactId>
<version>4.23.0-SNAPSHOT</version>
</dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-reactive-executor-tomcat</artifactId>
- <version>4.23.0-SNAPSHOT</version>
- </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-reactive-executor-vertx</artifactId>
diff --git a/catalog/camel-allcomponents/pom.xml
b/catalog/camel-allcomponents/pom.xml
index 4f15ef1665d9..e0287cf9f870 100644
--- a/catalog/camel-allcomponents/pom.xml
+++ b/catalog/camel-allcomponents/pom.xml
@@ -1847,11 +1847,6 @@
<artifactId>camel-quickfix</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-reactive-executor-tomcat</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-reactive-executor-vertx</artifactId>
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties
index 4e42f82e4341..da277bd602e2 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs.properties
@@ -511,7 +511,6 @@ qdrant-component
quartz-component
quickfix-component
randomLoadBalancer-eip
-reactive-executor-tomcat
reactive-executor-vertx
reactive-streams-component
reactor
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/reactive-executor-tomcat.adoc
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/reactive-executor-tomcat.adoc
deleted file mode 100644
index 7758a843a5d8..000000000000
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/reactive-executor-tomcat.adoc
+++ /dev/null
@@ -1,40 +0,0 @@
-= Reactive Executor Tomcat Component (deprecated)
-:doctitle: Reactive Executor Tomcat
-:shortname: reactive-executor-tomcat
-:artifactid: camel-reactive-executor-tomcat
-:description: Reactive Executor for camel-core using Apache Tomcat (deprecated)
-:since: 3.17
-:supportlevel: Experimental-deprecated
-:deprecated: *deprecated*
-:tabs-sync-option:
-
-*Since Camel {since}*
-
-*Deprecated since Camel 4.22*
-
-[WARNING]
-====
-This component is deprecated and will be removed in a future release.
-Use the default `ReactiveExecutor` (built into `camel-core`) instead.
-====
-
-The `camel-reactive-executor-tomcat` was intended for users of Apache Tomcat,
-to let Camel applications shutdown cleanly when being un-deployed in Apache
Tomcat.
-
-The cross-thread `ThreadLocal` cleanup that distinguished this component from
the default
-`ReactiveExecutor` relied on reflective access to the private
`Thread.threadLocals` field.
-This approach is denied by the JDK module system since JDK 17 and is
incompatible with
-virtual threads. Without that cleanup, this executor is functionally identical
to the default.
-
-To migrate, simply remove the `camel-reactive-executor-tomcat` dependency from
your project.
-Camel will automatically use the built-in `DefaultReactiveExecutor`.
-
-== Auto-detection from classpath
-
-To use this implementation all you need to do is to add the
`camel-reactive-executor-tomcat` dependency to the classpath,
-and Camel should auto-detect this on startup and log as follows:
-
-[source,text]
-----
-Using ReactiveExecutor: camel-reactive-executor-tomcat
-----
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others.properties
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others.properties
index ab447a881459..4b3d6de51bec 100644
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others.properties
+++
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others.properties
@@ -46,7 +46,6 @@ opentelemetry2
platform-http-jolokia
platform-http-main
platform-http-vertx
-reactive-executor-tomcat
reactive-executor-vertx
reactor
redis
diff --git
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others/reactive-executor-tomcat.json
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others/reactive-executor-tomcat.json
deleted file mode 100644
index 395e8cc1b3d1..000000000000
---
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others/reactive-executor-tomcat.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "other": {
- "kind": "other",
- "name": "reactive-executor-tomcat",
- "title": "Reactive Executor Tomcat",
- "description": "Reactive Executor for camel-core using Apache Tomcat
(deprecated)",
- "deprecated": true,
- "firstVersion": "3.17.0",
- "label": "reactive",
- "supportLevel": "Experimental",
- "groupId": "org.apache.camel",
- "artifactId": "camel-reactive-executor-tomcat",
- "version": "4.23.0-SNAPSHOT"
- }
-}
diff --git a/components/camel-reactive-executor-tomcat/pom.xml
b/components/camel-reactive-executor-tomcat/pom.xml
deleted file mode 100644
index d878effd240e..000000000000
--- a/components/camel-reactive-executor-tomcat/pom.xml
+++ /dev/null
@@ -1,66 +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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.camel</groupId>
- <artifactId>components</artifactId>
- <version>4.23.0-SNAPSHOT</version>
- </parent>
-
- <artifactId>camel-reactive-executor-tomcat</artifactId>
- <packaging>jar</packaging>
- <name>Camel :: Reactive Executor :: Tomcat (deprecated)</name>
- <description>Reactive Executor for camel-core using Apache Tomcat
(deprecated)</description>
-
- <properties>
- <firstVersion>3.17.0</firstVersion>
- <label>reactive</label>
- <title>Reactive Executor Tomcat</title>
- <supportLevel>Experimental</supportLevel>
- </properties>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-support</artifactId>
- </dependency>
-
- <!-- testing -->
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-test-junit6</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-mock</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.junit.jupiter</groupId>
- <artifactId>junit-jupiter</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
diff --git
a/components/camel-reactive-executor-tomcat/src/generated/resources/META-INF/services/org/apache/camel/other.properties
b/components/camel-reactive-executor-tomcat/src/generated/resources/META-INF/services/org/apache/camel/other.properties
deleted file mode 100644
index 0458980ac570..000000000000
---
a/components/camel-reactive-executor-tomcat/src/generated/resources/META-INF/services/org/apache/camel/other.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-name=reactive-executor-tomcat
-groupId=org.apache.camel
-artifactId=camel-reactive-executor-tomcat
-version=4.23.0-SNAPSHOT
-projectName=Camel :: Reactive Executor :: Tomcat (deprecated)
-projectDescription=Reactive Executor for camel-core using Apache Tomcat
(deprecated)
diff --git
a/components/camel-reactive-executor-tomcat/src/generated/resources/META-INF/services/org/apache/camel/reactive-executor
b/components/camel-reactive-executor-tomcat/src/generated/resources/META-INF/services/org/apache/camel/reactive-executor
deleted file mode 100644
index 1094ef20cd72..000000000000
---
a/components/camel-reactive-executor-tomcat/src/generated/resources/META-INF/services/org/apache/camel/reactive-executor
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.reactive.tomcat.TomcatReactiveExecutor
diff --git
a/components/camel-reactive-executor-tomcat/src/generated/resources/reactive-executor-tomcat.json
b/components/camel-reactive-executor-tomcat/src/generated/resources/reactive-executor-tomcat.json
deleted file mode 100644
index 395e8cc1b3d1..000000000000
---
a/components/camel-reactive-executor-tomcat/src/generated/resources/reactive-executor-tomcat.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "other": {
- "kind": "other",
- "name": "reactive-executor-tomcat",
- "title": "Reactive Executor Tomcat",
- "description": "Reactive Executor for camel-core using Apache Tomcat
(deprecated)",
- "deprecated": true,
- "firstVersion": "3.17.0",
- "label": "reactive",
- "supportLevel": "Experimental",
- "groupId": "org.apache.camel",
- "artifactId": "camel-reactive-executor-tomcat",
- "version": "4.23.0-SNAPSHOT"
- }
-}
diff --git
a/components/camel-reactive-executor-tomcat/src/main/docs/reactive-executor-tomcat.adoc
b/components/camel-reactive-executor-tomcat/src/main/docs/reactive-executor-tomcat.adoc
deleted file mode 100644
index 7758a843a5d8..000000000000
---
a/components/camel-reactive-executor-tomcat/src/main/docs/reactive-executor-tomcat.adoc
+++ /dev/null
@@ -1,40 +0,0 @@
-= Reactive Executor Tomcat Component (deprecated)
-:doctitle: Reactive Executor Tomcat
-:shortname: reactive-executor-tomcat
-:artifactid: camel-reactive-executor-tomcat
-:description: Reactive Executor for camel-core using Apache Tomcat (deprecated)
-:since: 3.17
-:supportlevel: Experimental-deprecated
-:deprecated: *deprecated*
-:tabs-sync-option:
-
-*Since Camel {since}*
-
-*Deprecated since Camel 4.22*
-
-[WARNING]
-====
-This component is deprecated and will be removed in a future release.
-Use the default `ReactiveExecutor` (built into `camel-core`) instead.
-====
-
-The `camel-reactive-executor-tomcat` was intended for users of Apache Tomcat,
-to let Camel applications shutdown cleanly when being un-deployed in Apache
Tomcat.
-
-The cross-thread `ThreadLocal` cleanup that distinguished this component from
the default
-`ReactiveExecutor` relied on reflective access to the private
`Thread.threadLocals` field.
-This approach is denied by the JDK module system since JDK 17 and is
incompatible with
-virtual threads. Without that cleanup, this executor is functionally identical
to the default.
-
-To migrate, simply remove the `camel-reactive-executor-tomcat` dependency from
your project.
-Camel will automatically use the built-in `DefaultReactiveExecutor`.
-
-== Auto-detection from classpath
-
-To use this implementation all you need to do is to add the
`camel-reactive-executor-tomcat` dependency to the classpath,
-and Camel should auto-detect this on startup and log as follows:
-
-[source,text]
-----
-Using ReactiveExecutor: camel-reactive-executor-tomcat
-----
diff --git
a/components/camel-reactive-executor-tomcat/src/main/java/org/apache/camel/reactive/tomcat/TomcatReactiveExecutor.java
b/components/camel-reactive-executor-tomcat/src/main/java/org/apache/camel/reactive/tomcat/TomcatReactiveExecutor.java
deleted file mode 100644
index 07eefa78a781..000000000000
---
a/components/camel-reactive-executor-tomcat/src/main/java/org/apache/camel/reactive/tomcat/TomcatReactiveExecutor.java
+++ /dev/null
@@ -1,298 +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.reactive.tomcat;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.ArrayDeque;
-import java.util.Deque;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.LongAdder;
-
-import org.apache.camel.Experimental;
-import org.apache.camel.StaticService;
-import org.apache.camel.api.management.ManagedAttribute;
-import org.apache.camel.api.management.ManagedResource;
-import org.apache.camel.spi.ReactiveExecutor;
-import org.apache.camel.spi.annotations.JdkService;
-import org.apache.camel.support.ObjectHelper;
-import org.apache.camel.support.service.ServiceSupport;
-import org.apache.camel.util.ReflectionHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This reactive executor is intended for users of Apache Tomcat, to let Camel
applications shutdown cleanly when being
- * undeployed in Apache Tomcat.
- *
- * @deprecated since 4.22. The cross-thread ThreadLocal cleanup that
distinguished this component from
- * {@link org.apache.camel.impl.engine.DefaultReactiveExecutor}
relied on reflective access to the private
- * {@code Thread.threadLocals} field, which is denied by the JDK
module system since JDK 17 and is
- * incompatible with virtual threads. Without that cleanup, this
executor is functionally identical to the
- * default. Use {@code DefaultReactiveExecutor} instead (it is
used automatically when this module is not on
- * the classpath).
- */
-@Deprecated(since = "4.22")
-@ManagedResource(description = "Managed TomcatReactiveExecutor")
-@JdkService(ReactiveExecutor.FACTORY)
-@Experimental
-public class TomcatReactiveExecutor extends ServiceSupport implements
ReactiveExecutor, StaticService {
-
- private static final Logger LOG =
LoggerFactory.getLogger(TomcatReactiveExecutor.class);
-
- private static final int MAX_TRACKING_SIZE = 1000;
-
- // to keep track of threads in use
- private final ConcurrentMap<Thread, Field> threads = new
ConcurrentHashMap<>();
- private final TrackingThreadLocal workers = new TrackingThreadLocal();
-
- // use for statistics so we have insights at runtime
- private boolean statisticsEnabled;
- private final AtomicInteger createdWorkers = new AtomicInteger();
- private final LongAdder runningWorkers = new LongAdder();
- private final LongAdder pendingTasks = new LongAdder();
-
- /**
- * ThreadLocal which keep tracks of all the threads that are using it, to
ensure we can remove all these threads
- * when Camel is shutting down to not keep stale ThreadLocal which can
have some application servers report this as
- * a potential thread-leak (such as Apache Tomcat).
- */
- private final class TrackingThreadLocal extends ThreadLocal<Worker> {
-
- @Override
- protected Worker initialValue() {
- try {
- // fail-safe to store max
- if (threads.size() < MAX_TRACKING_SIZE) {
- Thread t = Thread.currentThread();
- Field f = Thread.class.getDeclaredField("threadLocals");
- threads.putIfAbsent(t, f);
- }
- } catch (Exception e) {
- // ignore
- }
- int number = createdWorkers.incrementAndGet();
- return new Worker(number, TomcatReactiveExecutor.this);
- }
-
- @Override
- public String toString() {
- return "CamelTomcatReactiveWorker";
- }
- }
-
- private void clearWorkers() {
- int size = threads.size();
- threads.forEach((t, f) -> {
- try {
- Object map = ReflectionHelper.getField(f, t);
- if (map != null) {
- Method m = ReflectionHelper.findMethod(map.getClass(),
"remove", ThreadLocal.class);
- if (m != null) {
- ObjectHelper.invokeMethodSafe(m, map, this);
- }
- }
- } catch (Exception e) {
- // ignore
- }
- });
- threads.clear();
-
- if (size > 0) {
- LOG.info("Cleared {} ThreadLocals", size);
- }
- }
-
- @Override
- public void schedule(Runnable runnable) {
- workers.get().schedule(runnable, false, false, false);
- }
-
- @Override
- public void scheduleMain(Runnable runnable) {
- workers.get().schedule(runnable, true, true, false);
- }
-
- @Override
- public void scheduleSync(Runnable runnable) {
- workers.get().schedule(runnable, false, true, true);
- }
-
- @Override
- public void scheduleQueue(Runnable runnable) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("ScheduleQueue: {}", runnable);
- }
- workers.get().queue.add(runnable);
- }
-
- @Override
- public boolean executeFromQueue() {
- return workers.get().executeFromQueue();
- }
-
- @Override
- @ManagedAttribute(description = "Whether statistics is enabled")
- public boolean isStatisticsEnabled() {
- return statisticsEnabled;
- }
-
- @Override
- public void setStatisticsEnabled(boolean statisticsEnabled) {
- this.statisticsEnabled = statisticsEnabled;
- }
-
- @ManagedAttribute(description = "Number of created workers")
- public int getCreatedWorkers() {
- return createdWorkers.get();
- }
-
- @ManagedAttribute(description = "Number of running workers")
- public int getRunningWorkers() {
- return runningWorkers.intValue();
- }
-
- @ManagedAttribute(description = "Number of pending tasks")
- public int getPendingTasks() {
- return pendingTasks.intValue();
- }
-
- @Override
- protected void doStop() throws Exception {
- if (LOG.isDebugEnabled() && statisticsEnabled) {
- LOG.debug("Stopping TomcatReactiveExecutor [createdWorkers: {},
runningWorkers: {}, pendingTasks: {}]",
- getCreatedWorkers(), getRunningWorkers(),
getPendingTasks());
- }
- }
-
- @Override
- protected void doShutdown() throws Exception {
- // cleanup workers
- clearWorkers();
- }
-
- @Override
- public String toString() {
- return "camel-reactive-executor-tomcat";
- }
-
- private static class Worker {
-
- private final int number;
- private final TomcatReactiveExecutor executor;
- private final boolean stats;
- private volatile Deque<Runnable> queue = new ArrayDeque<>();
- private volatile Deque<Deque<Runnable>> back;
- private volatile boolean running;
-
- public Worker(int number, TomcatReactiveExecutor executor) {
- this.number = number;
- this.executor = executor;
- this.stats = executor != null && executor.isStatisticsEnabled();
- }
-
- void schedule(Runnable runnable, boolean first, boolean main, boolean
sync) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Schedule [first={}, main={}, sync={}]: {}", first,
main, sync, runnable);
- }
- if (main) {
- if (!queue.isEmpty()) {
- if (back == null) {
- back = new ArrayDeque<>();
- }
- back.push(queue);
- queue = new ArrayDeque<>();
- }
- }
- if (first) {
- queue.addFirst(runnable);
- if (stats) {
- executor.pendingTasks.increment();
- }
- } else {
- queue.addLast(runnable);
- if (stats) {
- executor.pendingTasks.increment();
- }
- }
- if (!running || sync) {
- running = true;
- if (stats) {
- executor.runningWorkers.increment();
- }
- try {
- for (;;) {
- final Runnable polled = queue.pollFirst();
- if (polled == null) {
- if (back != null && !back.isEmpty()) {
- queue = back.pollFirst();
- continue;
- } else {
- break;
- }
- }
- try {
- if (stats) {
- executor.pendingTasks.decrement();
- }
- if (LOG.isTraceEnabled()) {
- LOG.trace("Worker #{} running: {}", number,
polled);
- }
- polled.run();
- } catch (Exception e) {
- LOG.warn("Error executing reactive work due to {}.
This exception is ignored.",
- e.getMessage(), e);
- }
- }
- } finally {
- running = false;
- if (stats) {
- executor.runningWorkers.decrement();
- }
- }
- } else {
- if (LOG.isTraceEnabled()) {
- LOG.trace("Queuing reactive work: {}", runnable);
- }
- }
- }
-
- boolean executeFromQueue() {
- final Runnable polled = queue != null ? queue.pollFirst() : null;
- if (polled == null) {
- return false;
- }
- try {
- if (stats) {
- executor.pendingTasks.decrement();
- }
- if (LOG.isTraceEnabled()) {
- LOG.trace("Running: {}", polled);
- }
- polled.run();
- } catch (Exception e) {
- // should not happen
- LOG.warn("Error executing reactive work due to {}. This
exception is ignored.", e.getMessage(), e);
- }
- return true;
- }
-
- }
-
-}
diff --git
a/components/camel-reactive-executor-tomcat/src/test/java/org/apache/camel/reactive/SimpleMockTest.java
b/components/camel-reactive-executor-tomcat/src/test/java/org/apache/camel/reactive/SimpleMockTest.java
deleted file mode 100644
index ed3a263440b0..000000000000
---
a/components/camel-reactive-executor-tomcat/src/test/java/org/apache/camel/reactive/SimpleMockTest.java
+++ /dev/null
@@ -1,65 +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.reactive;
-
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.mock.MockEndpoint;
-import org.apache.camel.reactive.tomcat.TomcatReactiveExecutor;
-import org.apache.camel.spi.ReactiveExecutor;
-import org.apache.camel.test.junit6.CamelTestSupport;
-import org.junit.jupiter.api.Assertions;
-import org.junit.jupiter.api.Test;
-
-public class SimpleMockTest extends CamelTestSupport {
-
- @Test
- public void testSimple() throws Exception {
- MockEndpoint mock = getMockEndpoint("mock:result");
- mock.expectedBodiesReceived("Hello World");
-
- template.sendBody("direct:start", "Hello World");
-
- MockEndpoint.assertIsSatisfied(context);
-
- ReactiveExecutor re =
context.getCamelContextExtension().getReactiveExecutor();
- Assertions.assertInstanceOf(TomcatReactiveExecutor.class, re);
- }
-
- @Test
- public void testSimpleTwoMessages() throws Exception {
- MockEndpoint mock = getMockEndpoint("mock:result");
- mock.expectedBodiesReceived("Hello World", "Bye World");
-
- template.sendBody("direct:start", "Hello World");
- template.sendBody("direct:start", "Bye World");
-
- MockEndpoint.assertIsSatisfied(context);
-
- ReactiveExecutor re =
context.getCamelContextExtension().getReactiveExecutor();
- Assertions.assertInstanceOf(TomcatReactiveExecutor.class, re);
- }
-
- @Override
- protected RouteBuilder createRouteBuilder() throws Exception {
- return new RouteBuilder() {
- @Override
- public void configure() throws Exception {
-
from("direct:start").to("log:foo").to("log:bar").to("mock:result");
- }
- };
- }
-}
diff --git
a/components/camel-reactive-executor-tomcat/src/test/resources/log4j2.properties
b/components/camel-reactive-executor-tomcat/src/test/resources/log4j2.properties
deleted file mode 100644
index 2cebd6af7e59..000000000000
---
a/components/camel-reactive-executor-tomcat/src/test/resources/log4j2.properties
+++ /dev/null
@@ -1,31 +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.
-## ---------------------------------------------------------------------------
-
-appender.out.type = File
-appender.out.name = out
-appender.out.fileName = target/camel-reactive-executor-vertx.log
-appender.out.layout.type = PatternLayout
-appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
-appender.stdout.type = Console
-appender.stdout.name = stdout
-appender.stdout.layout.type = PatternLayout
-appender.stdout.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
-
-rootLogger.level = INFO
-
-rootLogger.appenderRef.out.ref = out
-#rootLogger.appenderRef.out.ref = stdout
diff --git a/components/pom.xml b/components/pom.xml
index 93a3cf3b2146..22606dc7a8c9 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -276,7 +276,6 @@
<module>camel-python3</module>
<module>camel-quartz</module>
<module>camel-quickfix</module>
- <module>camel-reactive-executor-tomcat</module>
<module>camel-reactive-executor-vertx</module>
<module>camel-reactive-streams</module>
<module>camel-reactor</module>
diff --git a/coverage/pom.xml b/coverage/pom.xml
index 8e5b45dce4a9..7bb7c8e5da82 100644
--- a/coverage/pom.xml
+++ b/coverage/pom.xml
@@ -1872,11 +1872,6 @@
<artifactId>camel-quickfix</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-reactive-executor-tomcat</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-reactive-executor-vertx</artifactId>
diff --git
a/docs/components/modules/others/examples/json/reactive-executor-tomcat.json
b/docs/components/modules/others/examples/json/reactive-executor-tomcat.json
deleted file mode 120000
index 46af930a0901..000000000000
--- a/docs/components/modules/others/examples/json/reactive-executor-tomcat.json
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../../components/camel-reactive-executor-tomcat/src/generated/resources/reactive-executor-tomcat.json
\ No newline at end of file
diff --git a/docs/components/modules/others/nav.adoc
b/docs/components/modules/others/nav.adoc
index 176e4926c46c..fcc115d35433 100644
--- a/docs/components/modules/others/nav.adoc
+++ b/docs/components/modules/others/nav.adoc
@@ -76,7 +76,6 @@
** xref:platform-http-vertx.adoc[Platform Http Vertx]
** xref:pqc-hybrid.adoc[PQC Hybrid Cryptography]
** xref:pqc-key-lifecycle.adoc[PQC Key Lifecycle Management]
-** xref:reactive-executor-tomcat.adoc[Reactive Executor Tomcat]
** xref:reactive-executor-vertx.adoc[Reactive Executor Vert.x]
** xref:reactor.adoc[Reactor]
** xref:redis.adoc[Redis]
diff --git a/docs/components/modules/others/pages/reactive-executor-tomcat.adoc
b/docs/components/modules/others/pages/reactive-executor-tomcat.adoc
deleted file mode 120000
index f0a39c6a773c..000000000000
--- a/docs/components/modules/others/pages/reactive-executor-tomcat.adoc
+++ /dev/null
@@ -1 +0,0 @@
-../../../../../components/camel-reactive-executor-tomcat/src/main/docs/reactive-executor-tomcat.adoc
\ No newline at end of file
diff --git
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc
index 2f308e1c2c6e..086b3a990363 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_23.adoc
@@ -19,6 +19,18 @@ See the xref:camel-upgrade-recipes-tool.adoc[documentation]
page for details.
`camel-leveldb` was deprecated in 4.18. `leveldb` library is no more
maintained and it exists several alternatives for file-based database nowadays.
+=== camel-reactive-executor-tomcat
+
+The `camel-reactive-executor-tomcat` component has been deprecated in 4.22. It
is now removed.
+
+Its cross-thread `ThreadLocal`
+cleanup relied on reflective access to the private `Thread.threadLocals`
field, which is denied by
+the JDK module system since JDK 17 and is incompatible with virtual threads.
Without that cleanup,
+this executor is functionally identical to the built-in
`DefaultReactiveExecutor`.
+
+To migrate, remove the `camel-reactive-executor-tomcat` dependency from your
project. Camel will
+automatically use the default reactive executor.
+
==== camel-zeebe
`camel-zeebe` component was deprecated in 4.19 and has a straightforward
replacement with `camel-camunda`. It is removed in 4.23.
diff --git a/parent/pom.xml b/parent/pom.xml
index fbd562abf3c6..5a8c7333443c 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -2542,11 +2542,6 @@
<artifactId>camel-quickfix</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-reactive-executor-tomcat</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-reactive-executor-vertx</artifactId>