You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2022/03/02 09:00:30 UTC

[camel-quarkus] branch camel-main updated (490aca2d -> 4002497)

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

jamesnetherton pushed a change to branch camel-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git.


 discard 490aca2d Temporary hacks to handle version misalignment of smallrye-health and smallrye-faulttolerance in Quarkus & Camel
 discard f947139  Test for Debezium mysql - passing additionalProperties results in wrong properties beeing passed #3488
 discard 21d96a5  Upgrade Camel to 3.16.0
     new ccfe848  Upgrade Camel to 3.16.0
     new 7bbd7cc  Test for Debezium mysql - passing additionalProperties results in wrong properties beeing passed #3488
     new 4002497  Temporary hacks to handle version misalignment of smallrye-health and smallrye-faulttolerance in Quarkus & Camel

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (490aca2d)
            \
             N -- N -- N   refs/heads/camel-main (4002497)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 integration-tests/google-storage/pom.xml                    |  5 +++++
 .../google/storage/it/GoogleStorageTestResource.java        | 13 +++++++------
 2 files changed, 12 insertions(+), 6 deletions(-)

[camel-quarkus] 03/03: Temporary hacks to handle version misalignment of smallrye-health and smallrye-faulttolerance in Quarkus & Camel

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch camel-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 40024971e4dab6ff91199422f3b74c4873ba7d8e
Author: James Netherton <ja...@gmail.com>
AuthorDate: Fri Feb 11 10:08:03 2022 +0000

    Temporary hacks to handle version misalignment of smallrye-health and smallrye-faulttolerance in Quarkus & Camel
---
 .../MicroprofileFaultToleranceProcessor.java       |   9 +
 .../microprofile-fault-tolerance/runtime/pom.xml   |   2 +
 .../FaultToleranceConfiguration.java               | 120 +++++
 .../faulttolerance/FaultToleranceConstants.java}   |  21 +-
 .../faulttolerance/FaultToleranceProcessor.java    | 536 +++++++++++++++++++++
 .../FaultToleranceProcessorFactory.java}           |  28 +-
 .../faulttolerance/FaultToleranceReifier.java      | 193 ++++++++
 .../apache/camel/model/CircuitBreakerDefinition    |  18 +
 .../runtime/CamelMicroProfileHealthRecorder.java   |   3 +-
 ...amelQuarkusMicroProfileHealthCheckRegistry.java |  62 +++
 10 files changed, 958 insertions(+), 34 deletions(-)

diff --git a/extensions/microprofile-fault-tolerance/deployment/src/main/java/org/apache/camel/quarkus/component/microprofile/fault/tolerance/deployment/MicroprofileFaultToleranceProcessor.java b/extensions/microprofile-fault-tolerance/deployment/src/main/java/org/apache/camel/quarkus/component/microprofile/fault/tolerance/deployment/MicroprofileFaultToleranceProcessor.java
index 05673b1..6e8c382 100644
--- a/extensions/microprofile-fault-tolerance/deployment/src/main/java/org/apache/camel/quarkus/component/microprofile/fault/tolerance/deployment/MicroprofileFaultToleranceProcessor.java
+++ b/extensions/microprofile-fault-tolerance/deployment/src/main/java/org/apache/camel/quarkus/component/microprofile/fault/tolerance/deployment/MicroprofileFaultToleranceProcessor.java
@@ -16,9 +16,13 @@
  */
 package org.apache.camel.quarkus.component.microprofile.fault.tolerance.deployment;
 
+import java.nio.file.Paths;
+
 import io.quarkus.deployment.annotations.BuildStep;
 import io.quarkus.deployment.builditem.FeatureBuildItem;
 import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
+import org.apache.camel.component.microprofile.faulttolerance.FaultToleranceProcessorFactory;
+import org.apache.camel.quarkus.core.deployment.spi.CamelServiceBuildItem;
 
 class MicroprofileFaultToleranceProcessor {
 
@@ -35,4 +39,9 @@ class MicroprofileFaultToleranceProcessor {
                 "META-INF/services/org/apache/camel/model/CircuitBreakerDefinition");
     }
 
+    @BuildStep
+    CamelServiceBuildItem camelCronServicePattern() {
+        return new CamelServiceBuildItem(Paths.get("META-INF/services/org/apache/camel/model/CircuitBreakerDefinition"),
+                FaultToleranceProcessorFactory.class.getName());
+    }
 }
diff --git a/extensions/microprofile-fault-tolerance/runtime/pom.xml b/extensions/microprofile-fault-tolerance/runtime/pom.xml
index 3401f07..22e3962 100644
--- a/extensions/microprofile-fault-tolerance/runtime/pom.xml
+++ b/extensions/microprofile-fault-tolerance/runtime/pom.xml
@@ -56,10 +56,12 @@
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-core</artifactId>
         </dependency>
+        <!-- Not compatible with Quarkus 2.7.x
         <dependency>
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-microprofile-fault-tolerance</artifactId>
         </dependency>
+        -->
     </dependencies>
 
     <build>
diff --git a/extensions/microprofile-fault-tolerance/runtime/src/main/java/org/apache/camel/component/microprofile/faulttolerance/FaultToleranceConfiguration.java b/extensions/microprofile-fault-tolerance/runtime/src/main/java/org/apache/camel/component/microprofile/faulttolerance/FaultToleranceConfiguration.java
new file mode 100644
index 0000000..7cb3d4d
--- /dev/null
+++ b/extensions/microprofile-fault-tolerance/runtime/src/main/java/org/apache/camel/component/microprofile/faulttolerance/FaultToleranceConfiguration.java
@@ -0,0 +1,120 @@
+/*
+ * 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.microprofile.faulttolerance;
+
+public class FaultToleranceConfiguration {
+
+    private long delay;
+    private int successThreshold;
+    private int requestVolumeThreshold;
+    private float failureRatio;
+    private boolean timeoutEnabled;
+    private long timeoutDuration;
+    private int timeoutPoolSize;
+    private String timeoutExecutorServiceRef;
+    private boolean bulkheadEnabled;
+    private int bulkheadMaxConcurrentCalls;
+    private int bulkheadWaitingTaskQueue;
+
+    public long getDelay() {
+        return delay;
+    }
+
+    public void setDelay(long delay) {
+        this.delay = delay;
+    }
+
+    public int getSuccessThreshold() {
+        return successThreshold;
+    }
+
+    public void setSuccessThreshold(int successThreshold) {
+        this.successThreshold = successThreshold;
+    }
+
+    public int getRequestVolumeThreshold() {
+        return requestVolumeThreshold;
+    }
+
+    public void setRequestVolumeThreshold(int requestVolumeThreshold) {
+        this.requestVolumeThreshold = requestVolumeThreshold;
+    }
+
+    public float getFailureRatio() {
+        return failureRatio;
+    }
+
+    public void setFailureRatio(float failureRatio) {
+        this.failureRatio = failureRatio;
+    }
+
+    public boolean isTimeoutEnabled() {
+        return timeoutEnabled;
+    }
+
+    public void setTimeoutEnabled(boolean timeoutEnabled) {
+        this.timeoutEnabled = timeoutEnabled;
+    }
+
+    public long getTimeoutDuration() {
+        return timeoutDuration;
+    }
+
+    public void setTimeoutDuration(long timeoutDuration) {
+        this.timeoutDuration = timeoutDuration;
+    }
+
+    public int getTimeoutPoolSize() {
+        return timeoutPoolSize;
+    }
+
+    public void setTimeoutPoolSize(int timeoutPoolSize) {
+        this.timeoutPoolSize = timeoutPoolSize;
+    }
+
+    public String getTimeoutExecutorServiceRef() {
+        return timeoutExecutorServiceRef;
+    }
+
+    public void setTimeoutExecutorServiceRef(String timeoutExecutorServiceRef) {
+        this.timeoutExecutorServiceRef = timeoutExecutorServiceRef;
+    }
+
+    public boolean isBulkheadEnabled() {
+        return bulkheadEnabled;
+    }
+
+    public void setBulkheadEnabled(boolean bulkheadEnabled) {
+        this.bulkheadEnabled = bulkheadEnabled;
+    }
+
+    public int getBulkheadMaxConcurrentCalls() {
+        return bulkheadMaxConcurrentCalls;
+    }
+
+    public void setBulkheadMaxConcurrentCalls(int bulkheadMaxConcurrentCalls) {
+        this.bulkheadMaxConcurrentCalls = bulkheadMaxConcurrentCalls;
+    }
+
+    public int getBulkheadWaitingTaskQueue() {
+        return bulkheadWaitingTaskQueue;
+    }
+
+    public void setBulkheadWaitingTaskQueue(int bulkheadWaitingTaskQueue) {
+        this.bulkheadWaitingTaskQueue = bulkheadWaitingTaskQueue;
+    }
+}
diff --git a/extensions/microprofile-fault-tolerance/deployment/src/main/java/org/apache/camel/quarkus/component/microprofile/fault/tolerance/deployment/MicroprofileFaultToleranceProcessor.java b/extensions/microprofile-fault-tolerance/runtime/src/main/java/org/apache/camel/component/microprofile/faulttolerance/FaultToleranceConstants.java
similarity index 53%
copy from extensions/microprofile-fault-tolerance/deployment/src/main/java/org/apache/camel/quarkus/component/microprofile/fault/tolerance/deployment/MicroprofileFaultToleranceProcessor.java
copy to extensions/microprofile-fault-tolerance/runtime/src/main/java/org/apache/camel/component/microprofile/faulttolerance/FaultToleranceConstants.java
index 05673b1..3bb0027 100644
--- a/extensions/microprofile-fault-tolerance/deployment/src/main/java/org/apache/camel/quarkus/component/microprofile/fault/tolerance/deployment/MicroprofileFaultToleranceProcessor.java
+++ b/extensions/microprofile-fault-tolerance/runtime/src/main/java/org/apache/camel/component/microprofile/faulttolerance/FaultToleranceConstants.java
@@ -14,25 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.component.microprofile.fault.tolerance.deployment;
+package org.apache.camel.component.microprofile.faulttolerance;
 
-import io.quarkus.deployment.annotations.BuildStep;
-import io.quarkus.deployment.builditem.FeatureBuildItem;
-import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
+public interface FaultToleranceConstants {
 
-class MicroprofileFaultToleranceProcessor {
-
-    private static final String FEATURE = "camel-microprofile-fault-tolerance";
-
-    @BuildStep
-    FeatureBuildItem feature() {
-        return new FeatureBuildItem(FEATURE);
-    }
-
-    @BuildStep
-    NativeImageResourceBuildItem initResources() {
-        return new NativeImageResourceBuildItem(
-                "META-INF/services/org/apache/camel/model/CircuitBreakerDefinition");
-    }
+    String DEFAULT_FAULT_TOLERANCE_CONFIGURATION_ID = "fault-tolerance-configuration";
 
 }
diff --git a/extensions/microprofile-fault-tolerance/runtime/src/main/java/org/apache/camel/component/microprofile/faulttolerance/FaultToleranceProcessor.java b/extensions/microprofile-fault-tolerance/runtime/src/main/java/org/apache/camel/component/microprofile/faulttolerance/FaultToleranceProcessor.java
new file mode 100644
index 0000000..2195b89
--- /dev/null
+++ b/extensions/microprofile-fault-tolerance/runtime/src/main/java/org/apache/camel/component/microprofile/faulttolerance/FaultToleranceProcessor.java
@@ -0,0 +1,536 @@
+/*
+ * 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.microprofile.faulttolerance;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.ScheduledExecutorService;
+
+import io.smallrye.faulttolerance.core.FaultToleranceStrategy;
+import io.smallrye.faulttolerance.core.InvocationContext;
+import io.smallrye.faulttolerance.core.bulkhead.FutureThreadPoolBulkhead;
+import io.smallrye.faulttolerance.core.circuit.breaker.CircuitBreaker;
+import io.smallrye.faulttolerance.core.fallback.Fallback;
+import io.smallrye.faulttolerance.core.stopwatch.SystemStopwatch;
+import io.smallrye.faulttolerance.core.timeout.ScheduledExecutorTimeoutWatcher;
+import io.smallrye.faulttolerance.core.timeout.Timeout;
+import io.smallrye.faulttolerance.core.timeout.TimeoutWatcher;
+import io.smallrye.faulttolerance.core.util.SetOfThrowables;
+import org.apache.camel.AsyncCallback;
+import org.apache.camel.CamelContext;
+import org.apache.camel.CamelContextAware;
+import org.apache.camel.Exchange;
+import org.apache.camel.ExchangePropertyKey;
+import org.apache.camel.ExtendedCamelContext;
+import org.apache.camel.ExtendedExchange;
+import org.apache.camel.Navigate;
+import org.apache.camel.Processor;
+import org.apache.camel.Route;
+import org.apache.camel.RuntimeExchangeException;
+import org.apache.camel.api.management.ManagedAttribute;
+import org.apache.camel.api.management.ManagedResource;
+import org.apache.camel.processor.PooledExchangeTask;
+import org.apache.camel.processor.PooledExchangeTaskFactory;
+import org.apache.camel.processor.PooledTaskFactory;
+import org.apache.camel.processor.PrototypeTaskFactory;
+import org.apache.camel.spi.IdAware;
+import org.apache.camel.spi.ProcessorExchangeFactory;
+import org.apache.camel.spi.RouteIdAware;
+import org.apache.camel.spi.UnitOfWork;
+import org.apache.camel.support.AsyncProcessorSupport;
+import org.apache.camel.support.ExchangeHelper;
+import org.apache.camel.support.UnitOfWorkHelper;
+import org.apache.camel.support.service.ServiceHelper;
+import org.apache.camel.util.ObjectHelper;
+import org.eclipse.microprofile.faulttolerance.exceptions.CircuitBreakerOpenException;
+import org.eclipse.microprofile.faulttolerance.exceptions.TimeoutException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static io.smallrye.faulttolerance.core.Invocation.invocation;
+
+/**
+ * Implementation of Circuit Breaker EIP using microprofile fault tolerance.
+ */
+@ManagedResource(description = "Managed FaultTolerance Processor")
+public class FaultToleranceProcessor extends AsyncProcessorSupport
+        implements CamelContextAware, Navigate<Processor>, org.apache.camel.Traceable, IdAware, RouteIdAware {
+
+    private static final Logger LOG = LoggerFactory.getLogger(FaultToleranceProcessor.class);
+
+    private volatile CircuitBreaker circuitBreaker;
+    private CamelContext camelContext;
+    private String id;
+    private String routeId;
+    private final FaultToleranceConfiguration config;
+    private final Processor processor;
+    private final Processor fallbackProcessor;
+    private ScheduledExecutorService scheduledExecutorService;
+    private boolean shutdownScheduledExecutorService;
+    private ExecutorService executorService;
+    private boolean shutdownExecutorService;
+    private ProcessorExchangeFactory processorExchangeFactory;
+    private PooledExchangeTaskFactory taskFactory;
+    private PooledExchangeTaskFactory fallbackTaskFactory;
+
+    public FaultToleranceProcessor(FaultToleranceConfiguration config, Processor processor,
+            Processor fallbackProcessor) {
+        this.config = config;
+        this.processor = processor;
+        this.fallbackProcessor = fallbackProcessor;
+    }
+
+    @Override
+    public CamelContext getCamelContext() {
+        return camelContext;
+    }
+
+    @Override
+    public void setCamelContext(CamelContext camelContext) {
+        this.camelContext = camelContext;
+    }
+
+    @Override
+    public String getId() {
+        return id;
+    }
+
+    @Override
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    @Override
+    public String getRouteId() {
+        return routeId;
+    }
+
+    @Override
+    public void setRouteId(String routeId) {
+        this.routeId = routeId;
+    }
+
+    public CircuitBreaker getCircuitBreaker() {
+        return circuitBreaker;
+    }
+
+    public void setCircuitBreaker(CircuitBreaker circuitBreaker) {
+        this.circuitBreaker = circuitBreaker;
+    }
+
+    public boolean isShutdownExecutorService() {
+        return shutdownExecutorService;
+    }
+
+    public void setShutdownExecutorService(boolean shutdownExecutorService) {
+        this.shutdownExecutorService = shutdownExecutorService;
+    }
+
+    public ExecutorService getExecutorService() {
+        return executorService;
+    }
+
+    public void setExecutorService(ExecutorService executorService) {
+        this.executorService = executorService;
+    }
+
+    @Override
+    public String getTraceLabel() {
+        return "faultTolerance";
+    }
+
+    @ManagedAttribute(description = "Returns the current delay in milliseconds.")
+    public long getDelay() {
+        return config.getDelay();
+    }
+
+    @ManagedAttribute(description = "Returns the current failure rate in percentage.")
+    public float getFailureRate() {
+        return config.getFailureRatio();
+    }
+
+    @ManagedAttribute(description = "Returns the current request volume threshold.")
+    public int getRequestVolumeThreshold() {
+        return config.getRequestVolumeThreshold();
+    }
+
+    @ManagedAttribute(description = "Returns the current success threshold.")
+    public int getSuccessThreshold() {
+        return config.getSuccessThreshold();
+    }
+
+    @ManagedAttribute(description = "Is timeout enabled")
+    public boolean isTimeoutEnabled() {
+        return config.isTimeoutEnabled();
+    }
+
+    @ManagedAttribute(description = "The timeout wait duration")
+    public long getTimeoutDuration() {
+        return config.getTimeoutDuration();
+    }
+
+    @ManagedAttribute(description = "The timeout pool size for the thread pool")
+    public int getTimeoutPoolSize() {
+        return config.getTimeoutPoolSize();
+    }
+
+    @ManagedAttribute(description = "Is bulkhead enabled")
+    public boolean isBulkheadEnabled() {
+        return config.isBulkheadEnabled();
+    }
+
+    @ManagedAttribute(description = "The max amount of concurrent calls the bulkhead will support.")
+    public int getBulkheadMaxConcurrentCalls() {
+        return config.getBulkheadMaxConcurrentCalls();
+    }
+
+    @ManagedAttribute(description = "The task queue size for holding waiting tasks to be processed by the bulkhead")
+    public int getBulkheadWaitingTaskQueue() {
+        return config.getBulkheadWaitingTaskQueue();
+    }
+
+    @Override
+    public List<Processor> next() {
+        if (!hasNext()) {
+            return null;
+        }
+        List<Processor> answer = new ArrayList<>();
+        answer.add(processor);
+        if (fallbackProcessor != null) {
+            answer.add(fallbackProcessor);
+        }
+        return answer;
+    }
+
+    @Override
+    public boolean hasNext() {
+        return true;
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public boolean process(Exchange exchange, AsyncCallback callback) {
+        // run this as if we run inside try .. catch so there is no regular
+        // Camel error handler
+        exchange.setProperty(ExchangePropertyKey.TRY_ROUTE_BLOCK, true);
+
+        CircuitBreakerFallbackTask fallbackTask = null;
+        CircuitBreakerTask task = (CircuitBreakerTask) taskFactory.acquire(exchange, callback);
+
+        // circuit breaker
+        FaultToleranceStrategy target = circuitBreaker;
+
+        // 1. bulkhead
+        if (config.isBulkheadEnabled()) {
+            target = new FutureThreadPoolBulkhead(
+                    target, "bulkhead", config.getBulkheadMaxConcurrentCalls(),
+                    config.getBulkheadWaitingTaskQueue());
+        }
+        // 2. timeout
+        if (config.isTimeoutEnabled()) {
+            TimeoutWatcher watcher = new ScheduledExecutorTimeoutWatcher(scheduledExecutorService);
+            target = new Timeout(target, "timeout", config.getTimeoutDuration(), watcher);
+        }
+        // 3. fallback
+        if (fallbackProcessor != null) {
+            fallbackTask = (CircuitBreakerFallbackTask) fallbackTaskFactory.acquire(exchange, callback);
+            final CircuitBreakerFallbackTask fFallbackTask = fallbackTask;
+            target = new Fallback(target, "fallback", fallbackContext -> {
+                exchange.setException(fallbackContext.failure);
+                return fFallbackTask.call();
+            }, SetOfThrowables.ALL, SetOfThrowables.EMPTY);
+        }
+
+        try {
+            target.apply(new InvocationContext(task));
+        } catch (CircuitBreakerOpenException e) {
+            // the circuit breaker triggered a call rejected
+            exchange.setProperty(ExchangePropertyKey.CIRCUIT_BREAKER_RESPONSE_SUCCESSFUL_EXECUTION, false);
+            exchange.setProperty(ExchangePropertyKey.CIRCUIT_BREAKER_RESPONSE_FROM_FALLBACK, false);
+            exchange.setProperty(ExchangePropertyKey.CIRCUIT_BREAKER_RESPONSE_SHORT_CIRCUITED, true);
+            exchange.setProperty(ExchangePropertyKey.CIRCUIT_BREAKER_RESPONSE_REJECTED, true);
+        } catch (Exception e) {
+            // some other kind of exception
+            exchange.setException(e);
+        } finally {
+            taskFactory.release(task);
+            if (fallbackTask != null) {
+                fallbackTaskFactory.release(fallbackTask);
+            }
+        }
+
+        exchange.removeProperty(ExchangePropertyKey.TRY_ROUTE_BLOCK);
+        callback.done(true);
+        return true;
+    }
+
+    @Override
+    protected void doBuild() throws Exception {
+        ObjectHelper.notNull(camelContext, "CamelContext", this);
+
+        boolean pooled = camelContext.adapt(ExtendedCamelContext.class).getExchangeFactory().isPooled();
+        if (pooled) {
+            int capacity = camelContext.adapt(ExtendedCamelContext.class).getExchangeFactory().getCapacity();
+            taskFactory = new PooledTaskFactory(getId()) {
+                @Override
+                public PooledExchangeTask create(Exchange exchange, AsyncCallback callback) {
+                    return new CircuitBreakerTask();
+                }
+            };
+            taskFactory.setCapacity(capacity);
+            fallbackTaskFactory = new PooledTaskFactory(getId()) {
+                @Override
+                public PooledExchangeTask create(Exchange exchange, AsyncCallback callback) {
+                    return new CircuitBreakerFallbackTask();
+                }
+            };
+            fallbackTaskFactory.setCapacity(capacity);
+        } else {
+            taskFactory = new PrototypeTaskFactory() {
+                @Override
+                public PooledExchangeTask create(Exchange exchange, AsyncCallback callback) {
+                    return new CircuitBreakerTask();
+                }
+            };
+            fallbackTaskFactory = new PrototypeTaskFactory() {
+                @Override
+                public PooledExchangeTask create(Exchange exchange, AsyncCallback callback) {
+                    return new CircuitBreakerFallbackTask();
+                }
+            };
+        }
+
+        // create a per processor exchange factory
+        this.processorExchangeFactory = getCamelContext().adapt(ExtendedCamelContext.class)
+                .getProcessorExchangeFactory().newProcessorExchangeFactory(this);
+        this.processorExchangeFactory.setRouteId(getRouteId());
+        this.processorExchangeFactory.setId(getId());
+
+        ServiceHelper.buildService(processorExchangeFactory, taskFactory, fallbackTaskFactory, processor);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    protected void doInit() throws Exception {
+        ObjectHelper.notNull(camelContext, "CamelContext", this);
+        if (circuitBreaker == null) {
+            circuitBreaker = new CircuitBreaker(
+                    invocation(), id, SetOfThrowables.ALL,
+                    SetOfThrowables.EMPTY, config.getDelay(), config.getRequestVolumeThreshold(), config.getFailureRatio(),
+                    config.getSuccessThreshold(), new SystemStopwatch());
+        }
+
+        ServiceHelper.initService(processorExchangeFactory, taskFactory, fallbackTaskFactory, processor);
+    }
+
+    @Override
+    protected void doStart() throws Exception {
+        if (config.isTimeoutEnabled() && scheduledExecutorService == null) {
+            scheduledExecutorService = getCamelContext().getExecutorServiceManager().newScheduledThreadPool(this,
+                    "CircuitBreakerTimeout", config.getTimeoutPoolSize());
+            shutdownScheduledExecutorService = true;
+        }
+        if (config.isBulkheadEnabled() && executorService == null) {
+            executorService = getCamelContext().getExecutorServiceManager().newThreadPool(this, "CircuitBreakerBulkhead",
+                    config.getBulkheadMaxConcurrentCalls(), config.getBulkheadMaxConcurrentCalls());
+            shutdownExecutorService = true;
+        }
+
+        ServiceHelper.startService(processorExchangeFactory, taskFactory, fallbackTaskFactory, processor);
+    }
+
+    @Override
+    protected void doStop() throws Exception {
+        if (shutdownScheduledExecutorService && scheduledExecutorService != null) {
+            getCamelContext().getExecutorServiceManager().shutdownNow(scheduledExecutorService);
+            scheduledExecutorService = null;
+        }
+        if (shutdownExecutorService && executorService != null) {
+            getCamelContext().getExecutorServiceManager().shutdownNow(executorService);
+            executorService = null;
+        }
+
+        ServiceHelper.stopService(processorExchangeFactory, taskFactory, fallbackTaskFactory, processor);
+    }
+
+    @Override
+    protected void doShutdown() throws Exception {
+        ServiceHelper.stopAndShutdownServices(processorExchangeFactory, taskFactory, fallbackTaskFactory, processor);
+    }
+
+    private final class CircuitBreakerTask implements PooledExchangeTask, Callable<Exchange> {
+
+        private Exchange exchange;
+
+        @Override
+        public void prepare(Exchange exchange, AsyncCallback callback) {
+            this.exchange = exchange;
+            // callback not in use
+        }
+
+        @Override
+        public void reset() {
+            this.exchange = null;
+        }
+
+        @Override
+        public void run() {
+            // not in use
+        }
+
+        @Override
+        public Exchange call() throws Exception {
+            Exchange copy = null;
+            UnitOfWork uow = null;
+            Throwable cause;
+
+            // turn of interruption to allow fault tolerance to process the exchange under its handling
+            exchange.adapt(ExtendedExchange.class).setInterruptable(false);
+
+            try {
+                LOG.debug("Running processor: {} with exchange: {}", processor, exchange);
+
+                // prepare a copy of exchange so downstream processors don't
+                // cause side-effects if they mutate the exchange
+                // in case timeout processing and continue with the fallback etc
+                copy = processorExchangeFactory.createCorrelatedCopy(exchange, false);
+                if (copy.getUnitOfWork() != null) {
+                    uow = copy.getUnitOfWork();
+                } else {
+                    // prepare uow on copy
+                    uow = copy.getContext().adapt(ExtendedCamelContext.class).getUnitOfWorkFactory().createUnitOfWork(copy);
+                    copy.adapt(ExtendedExchange.class).setUnitOfWork(uow);
+                    // the copy must be starting from the route where its copied from
+                    Route route = ExchangeHelper.getRoute(exchange);
+                    if (route != null) {
+                        uow.pushRoute(route);
+                    }
+                }
+
+                // process the processor until its fully done
+                processor.process(copy);
+
+                // handle the processing result
+                if (copy.getException() != null) {
+                    exchange.setException(copy.getException());
+                } else {
+                    // copy the result as its regarded as success
+                    ExchangeHelper.copyResults(exchange, copy);
+                    exchange.setProperty(ExchangePropertyKey.CIRCUIT_BREAKER_RESPONSE_SUCCESSFUL_EXECUTION, true);
+                    exchange.setProperty(ExchangePropertyKey.CIRCUIT_BREAKER_RESPONSE_FROM_FALLBACK, false);
+                }
+            } catch (Exception e) {
+                exchange.setException(e);
+            } finally {
+                // must done uow
+                UnitOfWorkHelper.doneUow(uow, copy);
+                // remember any thrown exception
+                cause = exchange.getException();
+            }
+
+            // and release exchange back in pool
+            processorExchangeFactory.release(exchange);
+
+            if (cause != null) {
+                // throw exception so resilient4j know it was a failure
+                throw RuntimeExchangeException.wrapRuntimeException(cause);
+            }
+            return exchange;
+        }
+    }
+
+    private final class CircuitBreakerFallbackTask implements PooledExchangeTask, Callable<Exchange> {
+
+        private Exchange exchange;
+
+        @Override
+        public void prepare(Exchange exchange, AsyncCallback callback) {
+            this.exchange = exchange;
+            // callback not in use
+        }
+
+        @Override
+        public void reset() {
+            this.exchange = null;
+        }
+
+        @Override
+        public void run() {
+            // not in use
+        }
+
+        @Override
+        public Exchange call() throws Exception {
+            Throwable throwable = exchange.getException();
+            if (fallbackProcessor == null) {
+                if (throwable instanceof TimeoutException) {
+                    // the circuit breaker triggered a timeout (and there is no
+                    // fallback) so lets mark the exchange as failed
+                    exchange.setProperty(ExchangePropertyKey.CIRCUIT_BREAKER_RESPONSE_SUCCESSFUL_EXECUTION, false);
+                    exchange.setProperty(ExchangePropertyKey.CIRCUIT_BREAKER_RESPONSE_FROM_FALLBACK, false);
+                    exchange.setProperty(ExchangePropertyKey.CIRCUIT_BREAKER_RESPONSE_SHORT_CIRCUITED, false);
+                    exchange.setProperty(ExchangePropertyKey.CIRCUIT_BREAKER_RESPONSE_TIMED_OUT, true);
+                    exchange.setException(throwable);
+                    return exchange;
+                } else if (throwable instanceof CircuitBreakerOpenException) {
+                    // the circuit breaker triggered a call rejected
+                    exchange.setProperty(ExchangePropertyKey.CIRCUIT_BREAKER_RESPONSE_SUCCESSFUL_EXECUTION, false);
+                    exchange.setProperty(ExchangePropertyKey.CIRCUIT_BREAKER_RESPONSE_FROM_FALLBACK, false);
+                    exchange.setProperty(ExchangePropertyKey.CIRCUIT_BREAKER_RESPONSE_SHORT_CIRCUITED, true);
+                    exchange.setProperty(ExchangePropertyKey.CIRCUIT_BREAKER_RESPONSE_REJECTED, true);
+                    return exchange;
+                } else {
+                    // throw exception so fault tolerance know it was a failure
+                    throw RuntimeExchangeException.wrapRuntimeException(throwable);
+                }
+            }
+
+            // fallback route is handling the exception so its short-circuited
+            exchange.setProperty(ExchangePropertyKey.CIRCUIT_BREAKER_RESPONSE_SUCCESSFUL_EXECUTION, false);
+            exchange.setProperty(ExchangePropertyKey.CIRCUIT_BREAKER_RESPONSE_FROM_FALLBACK, true);
+            exchange.setProperty(ExchangePropertyKey.CIRCUIT_BREAKER_RESPONSE_SHORT_CIRCUITED, true);
+
+            // store the last to endpoint as the failure endpoint
+            if (exchange.getProperty(ExchangePropertyKey.FAILURE_ENDPOINT) == null) {
+                exchange.setProperty(ExchangePropertyKey.FAILURE_ENDPOINT,
+                        exchange.getProperty(ExchangePropertyKey.TO_ENDPOINT));
+            }
+            // give the rest of the pipeline another chance
+            exchange.setProperty(ExchangePropertyKey.EXCEPTION_HANDLED, true);
+            exchange.setProperty(ExchangePropertyKey.EXCEPTION_CAUGHT, exchange.getException());
+            exchange.setRouteStop(false);
+            exchange.setException(null);
+            // and we should not be regarded as exhausted as we are in a try ..
+            // catch block
+            exchange.adapt(ExtendedExchange.class).setRedeliveryExhausted(false);
+            // run the fallback processor
+            try {
+                LOG.debug("Running fallback: {} with exchange: {}", fallbackProcessor, exchange);
+                // process the fallback until its fully done
+                fallbackProcessor.process(exchange);
+                LOG.debug("Running fallback: {} with exchange: {} done", fallbackProcessor, exchange);
+            } catch (Exception e) {
+                exchange.setException(e);
+            }
+
+            return exchange;
+        }
+    }
+
+}
diff --git a/extensions/microprofile-fault-tolerance/deployment/src/main/java/org/apache/camel/quarkus/component/microprofile/fault/tolerance/deployment/MicroprofileFaultToleranceProcessor.java b/extensions/microprofile-fault-tolerance/runtime/src/main/java/org/apache/camel/component/microprofile/faulttolerance/FaultToleranceProcessorFactory.java
similarity index 52%
copy from extensions/microprofile-fault-tolerance/deployment/src/main/java/org/apache/camel/quarkus/component/microprofile/fault/tolerance/deployment/MicroprofileFaultToleranceProcessor.java
copy to extensions/microprofile-fault-tolerance/runtime/src/main/java/org/apache/camel/component/microprofile/faulttolerance/FaultToleranceProcessorFactory.java
index 05673b1..2b70ca9 100644
--- a/extensions/microprofile-fault-tolerance/deployment/src/main/java/org/apache/camel/quarkus/component/microprofile/fault/tolerance/deployment/MicroprofileFaultToleranceProcessor.java
+++ b/extensions/microprofile-fault-tolerance/runtime/src/main/java/org/apache/camel/component/microprofile/faulttolerance/FaultToleranceProcessorFactory.java
@@ -14,25 +14,25 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.component.microprofile.fault.tolerance.deployment;
+package org.apache.camel.component.microprofile.faulttolerance;
 
-import io.quarkus.deployment.annotations.BuildStep;
-import io.quarkus.deployment.builditem.FeatureBuildItem;
-import io.quarkus.deployment.builditem.nativeimage.NativeImageResourceBuildItem;
+import org.apache.camel.Processor;
+import org.apache.camel.Route;
+import org.apache.camel.model.CircuitBreakerDefinition;
+import org.apache.camel.support.TypedProcessorFactory;
 
-class MicroprofileFaultToleranceProcessor {
-
-    private static final String FEATURE = "camel-microprofile-fault-tolerance";
+/**
+ * To integrate camel-microprofile-faulttolerance with the Camel routes using the Circuit Breaker EIP.
+ */
+public class FaultToleranceProcessorFactory extends TypedProcessorFactory<CircuitBreakerDefinition> {
 
-    @BuildStep
-    FeatureBuildItem feature() {
-        return new FeatureBuildItem(FEATURE);
+    public FaultToleranceProcessorFactory() {
+        super(CircuitBreakerDefinition.class);
     }
 
-    @BuildStep
-    NativeImageResourceBuildItem initResources() {
-        return new NativeImageResourceBuildItem(
-                "META-INF/services/org/apache/camel/model/CircuitBreakerDefinition");
+    @Override
+    public Processor doCreateProcessor(Route route, CircuitBreakerDefinition definition) throws Exception {
+        return new FaultToleranceReifier(route, definition).createProcessor();
     }
 
 }
diff --git a/extensions/microprofile-fault-tolerance/runtime/src/main/java/org/apache/camel/component/microprofile/faulttolerance/FaultToleranceReifier.java b/extensions/microprofile-fault-tolerance/runtime/src/main/java/org/apache/camel/component/microprofile/faulttolerance/FaultToleranceReifier.java
new file mode 100644
index 0000000..5aecfde
--- /dev/null
+++ b/extensions/microprofile-fault-tolerance/runtime/src/main/java/org/apache/camel/component/microprofile/faulttolerance/FaultToleranceReifier.java
@@ -0,0 +1,193 @@
+/*
+ * 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.microprofile.faulttolerance;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Optional;
+import java.util.concurrent.ExecutorService;
+
+import io.smallrye.faulttolerance.core.circuit.breaker.CircuitBreaker;
+import org.apache.camel.ExtendedCamelContext;
+import org.apache.camel.Processor;
+import org.apache.camel.Route;
+import org.apache.camel.model.CircuitBreakerDefinition;
+import org.apache.camel.model.FaultToleranceConfigurationCommon;
+import org.apache.camel.model.FaultToleranceConfigurationDefinition;
+import org.apache.camel.model.Model;
+import org.apache.camel.reifier.ProcessorReifier;
+import org.apache.camel.spi.BeanIntrospection;
+import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
+import org.apache.camel.spi.PropertyConfigurer;
+import org.apache.camel.support.PropertyBindingSupport;
+import org.apache.camel.util.function.Suppliers;
+
+public class FaultToleranceReifier extends ProcessorReifier<CircuitBreakerDefinition> {
+
+    public FaultToleranceReifier(Route route, CircuitBreakerDefinition definition) {
+        super(route, definition);
+    }
+
+    @Override
+    public Processor createProcessor() throws Exception {
+        // create the regular and fallback processors
+        Processor processor = createChildProcessor(true);
+        Processor fallback = null;
+        if (definition.getOnFallback() != null) {
+            fallback = createProcessor(definition.getOnFallback());
+        }
+        boolean fallbackViaNetwork = definition.getOnFallback() != null
+                && parseBoolean(definition.getOnFallback().getFallbackViaNetwork(), false);
+        if (fallbackViaNetwork) {
+            throw new UnsupportedOperationException("camel-microprofile-fault-tolerance does not support onFallbackViaNetwork");
+        }
+        final FaultToleranceConfigurationCommon config = buildFaultToleranceConfiguration();
+
+        FaultToleranceConfiguration configuration = new FaultToleranceConfiguration();
+        configureCircuitBreaker(config, configuration);
+        configureTimeLimiter(config, configuration);
+        configureBulkhead(config, configuration);
+
+        FaultToleranceProcessor answer = new FaultToleranceProcessor(configuration, processor, fallback);
+        // using any existing circuit breakers?
+        if (config.getCircuitBreaker() != null) {
+            CircuitBreaker cb = mandatoryLookup(parseString(config.getCircuitBreaker()), CircuitBreaker.class);
+            answer.setCircuitBreaker(cb);
+        }
+        configureBulkheadExecutorService(answer, config);
+        return answer;
+    }
+
+    private void configureCircuitBreaker(FaultToleranceConfigurationCommon config, FaultToleranceConfiguration target) {
+        target.setDelay(parseDuration(config.getDelay(), 5000));
+        target.setSuccessThreshold(parseInt(config.getSuccessThreshold(), 1));
+        target.setRequestVolumeThreshold(parseInt(config.getRequestVolumeThreshold(), 20));
+        if (config.getFailureRatio() != null) {
+            float num = parseFloat(config.getFailureRatio(), 50);
+            if (num < 1 || num > 100) {
+                throw new IllegalArgumentException("FailureRatio must be between 1 and 100, was: " + num);
+            }
+            float percent = num / 100;
+            target.setFailureRatio(percent);
+        } else {
+            target.setFailureRatio(0.5f);
+        }
+    }
+
+    private void configureTimeLimiter(FaultToleranceConfigurationCommon config, FaultToleranceConfiguration target) {
+        if (!parseBoolean(config.getTimeoutEnabled(), false)) {
+            target.setTimeoutEnabled(false);
+        } else {
+            target.setTimeoutEnabled(true);
+        }
+
+        target.setTimeoutDuration(parseDuration(config.getTimeoutDuration(), 1000));
+        target.setTimeoutPoolSize(parseInt(config.getTimeoutPoolSize(), 10));
+    }
+
+    private void configureBulkhead(FaultToleranceConfigurationCommon config, FaultToleranceConfiguration target) {
+        if (!parseBoolean(config.getBulkheadEnabled(), false)) {
+            return;
+        }
+
+        target.setBulkheadMaxConcurrentCalls(parseInt(config.getBulkheadMaxConcurrentCalls(), 10));
+        target.setBulkheadWaitingTaskQueue(parseInt(config.getBulkheadWaitingTaskQueue(), 10));
+    }
+
+    private void configureBulkheadExecutorService(FaultToleranceProcessor processor, FaultToleranceConfigurationCommon config) {
+        if (!parseBoolean(config.getBulkheadEnabled(), false)) {
+            return;
+        }
+
+        if (config.getBulkheadExecutorService() != null) {
+            String ref = config.getBulkheadExecutorService();
+            boolean shutdownThreadPool = false;
+            ExecutorService executorService = lookup(ref, ExecutorService.class);
+            if (executorService == null) {
+                executorService = lookupExecutorServiceRef("CircuitBreaker", definition, ref);
+                shutdownThreadPool = true;
+            }
+            processor.setExecutorService(executorService);
+            processor.setShutdownExecutorService(shutdownThreadPool);
+        }
+    }
+
+    // *******************************
+    // Helpers
+    // *******************************
+
+    FaultToleranceConfigurationDefinition buildFaultToleranceConfiguration() throws Exception {
+        Map<String, Object> properties = new HashMap<>();
+
+        final PropertyConfigurer configurer = camelContext.adapt(ExtendedCamelContext.class)
+                .getConfigurerResolver()
+                .resolvePropertyConfigurer(FaultToleranceConfigurationDefinition.class.getName(), camelContext);
+
+        // Extract properties from default configuration, the one configured on
+        // camel context takes the precedence over those in the registry
+        loadProperties(properties, Suppliers.firstNotNull(
+                () -> camelContext.getExtension(Model.class).getFaultToleranceConfiguration(null),
+                () -> lookup(FaultToleranceConstants.DEFAULT_FAULT_TOLERANCE_CONFIGURATION_ID,
+                        FaultToleranceConfigurationDefinition.class)),
+                configurer);
+
+        // Extract properties from referenced configuration, the one configured
+        // on camel context takes the precedence over those in the registry
+        if (definition.getConfiguration() != null) {
+            final String ref = parseString(definition.getConfiguration());
+
+            loadProperties(properties, Suppliers.firstNotNull(
+                    () -> camelContext.getExtension(Model.class).getFaultToleranceConfiguration(ref),
+                    () -> mandatoryLookup(ref, FaultToleranceConfigurationDefinition.class)),
+                    configurer);
+        }
+
+        // Extract properties from local configuration
+        loadProperties(properties, Optional.ofNullable(definition.getFaultToleranceConfiguration()), configurer);
+
+        // Apply properties to a new configuration
+        FaultToleranceConfigurationDefinition config = new FaultToleranceConfigurationDefinition();
+        PropertyBindingSupport.build()
+                .withCamelContext(camelContext)
+                .withConfigurer(configurer)
+                .withProperties(properties)
+                .withTarget(config)
+                .bind();
+
+        return config;
+    }
+
+    private void loadProperties(Map<String, Object> properties, Optional<?> optional, PropertyConfigurer configurer) {
+        BeanIntrospection beanIntrospection = camelContext.adapt(ExtendedCamelContext.class).getBeanIntrospection();
+        optional.ifPresent(bean -> {
+            if (configurer instanceof ExtendedPropertyConfigurerGetter) {
+                ExtendedPropertyConfigurerGetter getter = (ExtendedPropertyConfigurerGetter) configurer;
+                Map<String, Object> types = getter.getAllOptions(bean);
+                types.forEach((k, t) -> {
+                    Object value = getter.getOptionValue(bean, k, true);
+                    if (value != null) {
+                        properties.put(k, value);
+                    }
+                });
+            } else {
+                // no configurer found so use bean introspection (reflection)
+                beanIntrospection.getProperties(bean, properties, null, false);
+            }
+        });
+    }
+
+}
diff --git a/extensions/microprofile-fault-tolerance/runtime/src/main/resources/META-INF/services/org/apache/camel/model/CircuitBreakerDefinition b/extensions/microprofile-fault-tolerance/runtime/src/main/resources/META-INF/services/org/apache/camel/model/CircuitBreakerDefinition
new file mode 100644
index 0000000..c43d558
--- /dev/null
+++ b/extensions/microprofile-fault-tolerance/runtime/src/main/resources/META-INF/services/org/apache/camel/model/CircuitBreakerDefinition
@@ -0,0 +1,18 @@
+#
+# 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.
+#
+
+class=org.apache.camel.component.microprofile.faulttolerance.FaultToleranceProcessorFactory
diff --git a/extensions/microprofile-health/runtime/src/main/java/org/apache/camel/quarkus/component/microprofile/health/runtime/CamelMicroProfileHealthRecorder.java b/extensions/microprofile-health/runtime/src/main/java/org/apache/camel/quarkus/component/microprofile/health/runtime/CamelMicroProfileHealthRecorder.java
index e33777b..907c133 100644
--- a/extensions/microprofile-health/runtime/src/main/java/org/apache/camel/quarkus/component/microprofile/health/runtime/CamelMicroProfileHealthRecorder.java
+++ b/extensions/microprofile-health/runtime/src/main/java/org/apache/camel/quarkus/component/microprofile/health/runtime/CamelMicroProfileHealthRecorder.java
@@ -20,7 +20,6 @@ import io.quarkus.runtime.RuntimeValue;
 import io.quarkus.runtime.annotations.Recorder;
 import org.apache.camel.CamelContext;
 import org.apache.camel.health.HealthCheckRegistry;
-import org.apache.camel.microprofile.health.CamelMicroProfileHealthCheckRegistry;
 import org.apache.camel.spi.CamelContextCustomizer;
 
 @Recorder
@@ -31,7 +30,7 @@ public class CamelMicroProfileHealthRecorder {
         return new RuntimeValue<>(new CamelContextCustomizer() {
             @Override
             public void configure(CamelContext camelContext) {
-                HealthCheckRegistry registry = new CamelMicroProfileHealthCheckRegistry(camelContext);
+                HealthCheckRegistry registry = new CamelQuarkusMicroProfileHealthCheckRegistry(camelContext);
                 registry.setId("camel-microprofile-health");
                 registry.setEnabled(true);
 
diff --git a/extensions/microprofile-health/runtime/src/main/java/org/apache/camel/quarkus/component/microprofile/health/runtime/CamelQuarkusMicroProfileHealthCheckRegistry.java b/extensions/microprofile-health/runtime/src/main/java/org/apache/camel/quarkus/component/microprofile/health/runtime/CamelQuarkusMicroProfileHealthCheckRegistry.java
new file mode 100644
index 0000000..8f51f80
--- /dev/null
+++ b/extensions/microprofile-health/runtime/src/main/java/org/apache/camel/quarkus/component/microprofile/health/runtime/CamelQuarkusMicroProfileHealthCheckRegistry.java
@@ -0,0 +1,62 @@
+/*
+ * 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.quarkus.component.microprofile.health.runtime;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.CDI;
+
+import io.smallrye.health.api.HealthRegistry;
+import io.smallrye.health.registry.LivenessHealthRegistry;
+import io.smallrye.health.registry.ReadinessHealthRegistry;
+import org.apache.camel.CamelContext;
+import org.apache.camel.microprofile.health.CamelMicroProfileHealthCheckRegistry;
+import org.eclipse.microprofile.health.Liveness;
+import org.eclipse.microprofile.health.Readiness;
+
+public class CamelQuarkusMicroProfileHealthCheckRegistry extends CamelMicroProfileHealthCheckRegistry {
+
+    CamelQuarkusMicroProfileHealthCheckRegistry(CamelContext camelContext) {
+        super(camelContext);
+    }
+
+    @Override
+    protected HealthRegistry getLivenessRegistry() {
+        return getHealthRegistryBean(LivenessHealthRegistry.class, Liveness.Literal.INSTANCE);
+    }
+
+    @Override
+    protected HealthRegistry getReadinessRegistry() {
+        return getHealthRegistryBean(ReadinessHealthRegistry.class, Readiness.Literal.INSTANCE);
+    }
+
+    private static HealthRegistry getHealthRegistryBean(Class<? extends HealthRegistry> type, Annotation qualifier) {
+        BeanManager beanManager = CDI.current().getBeanManager();
+        Set<Bean<?>> beans = beanManager.getBeans(type, qualifier);
+        if (beans.isEmpty()) {
+            throw new IllegalStateException(
+                    "Beans for type " + type.getName() + " with qualifier " + qualifier + " could not be found.");
+        }
+
+        Bean<?> bean = beanManager.resolve(beans);
+        Object reference = beanManager.getReference(bean, type, beanManager.createCreationalContext(bean));
+        return type.cast(reference);
+    }
+}

[camel-quarkus] 01/03: Upgrade Camel to 3.16.0

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch camel-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit ccfe8485d21c68a1c1e4bab89816f14a51822c8c
Author: James Netherton <ja...@gmail.com>
AuthorDate: Wed Feb 9 11:13:37 2022 +0000

    Upgrade Camel to 3.16.0
---
 docs/antora.yml                                    |  6 +-
 .../ROOT/pages/reference/extensions/yaml-dsl.adoc  |  6 --
 .../pages/user-guide/defining-camel-routes.adoc    |  6 +-
 .../deployment/MicroProfileHealthProcessor.java    |  5 --
 .../MicroProfileHealthCamelChecksDisabledTest.java |  6 +-
 extensions/openapi-java/deployment/pom.xml         |  5 ++
 .../openapi/java/deployment/RESTOpenAPITest.java   |  4 +-
 .../openapi/java/deployment/RestRoutes.java        |  7 +-
 .../src/test/resources/application.properties      |  2 +-
 .../resources/routes/{my-route.xml => rests.xml}   |  4 +-
 .../resources/routes/{my-route.xml => routes.xml}  | 16 ++--
 .../src/main/resources/application.properties      |  2 +-
 .../component/stream/it/StreamResource.java        |  2 +-
 .../quarkus/component/stream/it/StreamTest.java    |  2 +-
 integration-tests/google-storage/pom.xml           |  5 ++
 .../storage/it/GoogleStorageTestResource.java      | 13 +--
 .../quarkus/component/kafka/CamelKafkaRoutes.java  |  2 +-
 .../src/main/resources/rests/my-rests.xml          |  8 +-
 .../src/main/resources/routes/my-routes.xml        |  7 ++
 .../src/main/resources/rests/my-rests.xml          |  8 +-
 .../src/main/resources/routes/my-routes.xml        |  7 ++
 .../camel/quarkus/main/CoreMainXmlJaxbTest.java    |  2 +-
 .../src/main/resources/routes/my-rests.yaml        |  6 +-
 .../it/health/CustomHealthCheckRepository.java     | 17 ----
 .../microprofile/it/health/FailingHealthCheck.java |  2 +-
 .../it/health/FailureThresholdHealthCheck.java     | 51 ------------
 .../it/health/MicroProfileHealthResource.java      | 17 +---
 .../src/main/resources/application.properties      |  7 +-
 .../it/health/MicroProfileHealthTest.java          | 67 ----------------
 .../component/openapijava/it/OpenApiRoutes.java    | 44 ++++------
 .../openapijava/it/common/OpenApiTest.java         |  4 +-
 integration-tests/platform-http/pom.xml            | 17 ++++
 .../platform/http/it/PlatformHttpRouteBuilder.java | 18 ++---
 .../component/http/server/it/PlatformHttpTest.java |  4 +-
 integration-tests/rest/pom.xml                     | 17 ++++
 .../quarkus/component/rest/it/RestRoutes.java      | 93 +++++++++++-----------
 integration-tests/servlet/pom.xml                  | 21 ++++-
 .../quarkus/component/servlet/CamelRoute.java      | 19 +++--
 pom.xml                                            |  6 +-
 39 files changed, 215 insertions(+), 320 deletions(-)

diff --git a/docs/antora.yml b/docs/antora.yml
index e7cb3f5..1d3224b 100644
--- a/docs/antora.yml
+++ b/docs/antora.yml
@@ -29,11 +29,11 @@ asciidoc:
 
     min-maven-version: 3.8.1 # replace ${min-maven-version}
     target-maven-version: 3.8.4 # replace ${target-maven-version}
-    camel-version: 3.15.0 # replace ${camel.version}
-    camel-docs-version: 3.15.x # replace ${camel.docs.components.version}
+    camel-version: 3.16.0-SNAPSHOT # replace ${camel.version}
+    camel-docs-version: 3.16.x # replace ${camel.docs.components.version}
     quarkus-version: 2.7.2.Final # replace ${quarkus.version}
     graalvm-version: 21.3.1 # replace ${graalvm.version}
     graalvm-docs-version: 21.3
     # attributes used in xrefs to other Antora components
-    cq-camel-components: 3.15.x@components # replace ${camel.docs.components.xref}
+    cq-camel-components: 3.16.x@components # replace ${camel.docs.components.xref}
     quarkus-examples-version: latest
diff --git a/docs/modules/ROOT/pages/reference/extensions/yaml-dsl.adoc b/docs/modules/ROOT/pages/reference/extensions/yaml-dsl.adoc
index bdde5d3..26484a9 100644
--- a/docs/modules/ROOT/pages/reference/extensions/yaml-dsl.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/yaml-dsl.adoc
@@ -16,12 +16,6 @@
 
 An YAML stack for parsing YAML route definitions
 
-== What's inside
-
-* xref:{cq-camel-components}:others:yaml-dsl.adoc[YAML DSL]
-
-Please refer to the above link for usage and configuration details.
-
 == Maven coordinates
 
 https://code.quarkus.io/?extension-search=camel-quarkus-yaml-dsl[Create a new project with this extension on code.quarkus.io, window="_blank"]
diff --git a/docs/modules/ROOT/pages/user-guide/defining-camel-routes.adoc b/docs/modules/ROOT/pages/user-guide/defining-camel-routes.adoc
index 9ae1eaa..fc5b912 100644
--- a/docs/modules/ROOT/pages/user-guide/defining-camel-routes.adoc
+++ b/docs/modules/ROOT/pages/user-guide/defining-camel-routes.adoc
@@ -96,10 +96,8 @@ The route XML should be in the simplified version like:
 ----
 <rests xmlns="http://camel.apache.org/schema/spring">
     <rest id="greeting" path="/greeting">
-        <get uri="/hello">
-            <setBody>
-                <constant>Hello World!</constant>
-            </setBody>
+        <get path="/hello">
+            <to uri="direct:greet"/>
         </get>
     </rest>
 </rests>
diff --git a/extensions/microprofile-health/deployment/src/main/java/org/apache/camel/quarkus/component/microprofile/health/deployment/MicroProfileHealthProcessor.java b/extensions/microprofile-health/deployment/src/main/java/org/apache/camel/quarkus/component/microprofile/health/deployment/MicroProfileHealthProcessor.java
index 6ea3406..e5a3b9e 100644
--- a/extensions/microprofile-health/deployment/src/main/java/org/apache/camel/quarkus/component/microprofile/health/deployment/MicroProfileHealthProcessor.java
+++ b/extensions/microprofile-health/deployment/src/main/java/org/apache/camel/quarkus/component/microprofile/health/deployment/MicroProfileHealthProcessor.java
@@ -32,7 +32,6 @@ import org.apache.camel.health.HealthCheck;
 import org.apache.camel.health.HealthCheckRegistry;
 import org.apache.camel.health.HealthCheckRepository;
 import org.apache.camel.impl.health.ConsumersHealthCheckRepository;
-import org.apache.camel.impl.health.ContextHealthCheck;
 import org.apache.camel.impl.health.HealthCheckRegistryRepository;
 import org.apache.camel.impl.health.RoutesHealthCheckRepository;
 import org.apache.camel.quarkus.component.microprofile.health.runtime.CamelMicroProfileHealthConfig;
@@ -118,10 +117,6 @@ class MicroProfileHealthProcessor {
                 return false;
             }
 
-            if (className.equals(ContextHealthCheck.class.getName())) {
-                return config.getOptionalValue("camel.health.contextEnabled", boolean.class).orElse(true);
-            }
-
             if (className.equals(RoutesHealthCheckRepository.class.getName())) {
                 return config.getOptionalValue("camel.health.routesEnabled", boolean.class).orElse(true);
             }
diff --git a/extensions/microprofile-health/deployment/src/test/java/org/apache/camel/quarkus/component/microprofile/health/deployment/MicroProfileHealthCamelChecksDisabledTest.java b/extensions/microprofile-health/deployment/src/test/java/org/apache/camel/quarkus/component/microprofile/health/deployment/MicroProfileHealthCamelChecksDisabledTest.java
index 16e194a5..3e8b6df 100644
--- a/extensions/microprofile-health/deployment/src/test/java/org/apache/camel/quarkus/component/microprofile/health/deployment/MicroProfileHealthCamelChecksDisabledTest.java
+++ b/extensions/microprofile-health/deployment/src/test/java/org/apache/camel/quarkus/component/microprofile/health/deployment/MicroProfileHealthCamelChecksDisabledTest.java
@@ -37,6 +37,7 @@ import org.jboss.shrinkwrap.api.spec.JavaArchive;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
+import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
@@ -54,7 +55,6 @@ public class MicroProfileHealthCamelChecksDisabledTest {
         Writer writer = new StringWriter();
 
         Properties props = new Properties();
-        props.put("camel.health.contextEnabled", "false");
         props.put("camel.health.routesEnabled", "false");
         props.put("camel.health.consumersEnabled", "false");
         props.put("camel.health.registryEnabled", "false");
@@ -69,9 +69,9 @@ public class MicroProfileHealthCamelChecksDisabledTest {
     }
 
     @Test
-    public void contextHealthCheckNull() {
+    public void contextHealthCheckNotNull() {
         ContextHealthCheck contextHealthCheck = context.getRegistry().lookupByNameAndType("context", ContextHealthCheck.class);
-        assertNull(contextHealthCheck);
+        assertNotNull(contextHealthCheck);
     }
 
     @Test
diff --git a/extensions/openapi-java/deployment/pom.xml b/extensions/openapi-java/deployment/pom.xml
index 3ab740b..053ed8f 100644
--- a/extensions/openapi-java/deployment/pom.xml
+++ b/extensions/openapi-java/deployment/pom.xml
@@ -49,6 +49,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-direct</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-rest</artifactId>
             <scope>test</scope>
         </dependency>
diff --git a/extensions/openapi-java/deployment/src/test/java/org/apache/camel/quarkus/component/openapi/java/deployment/RESTOpenAPITest.java b/extensions/openapi-java/deployment/src/test/java/org/apache/camel/quarkus/component/openapi/java/deployment/RESTOpenAPITest.java
index 7e75be4..0ee6b74 100644
--- a/extensions/openapi-java/deployment/src/test/java/org/apache/camel/quarkus/component/openapi/java/deployment/RESTOpenAPITest.java
+++ b/extensions/openapi-java/deployment/src/test/java/org/apache/camel/quarkus/component/openapi/java/deployment/RESTOpenAPITest.java
@@ -17,7 +17,6 @@
 
 package org.apache.camel.quarkus.component.openapi.java.deployment;
 
-import java.io.File;
 import java.util.Arrays;
 
 import io.quarkus.bootstrap.model.AppArtifact;
@@ -41,7 +40,8 @@ public class RESTOpenAPITest {
             .withConfigurationResource("application.properties")
             .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)
                     .addClasses(RestRoutes.class, QuarkusResource.class)
-                    .addAsResource(new File("src/test/resources/routes/my-route.xml"), "routes/my-route.xml"));
+                    .addAsResource("routes/rests.xml", "routes/rests.xml")
+                    .addAsResource("routes/routes.xml", "routes/routes.xml"));
 
     @BeforeAll
     static void setUp() {
diff --git a/extensions/openapi-java/deployment/src/test/java/org/apache/camel/quarkus/component/openapi/java/deployment/RestRoutes.java b/extensions/openapi-java/deployment/src/test/java/org/apache/camel/quarkus/component/openapi/java/deployment/RestRoutes.java
index a2b1e91..358df70 100644
--- a/extensions/openapi-java/deployment/src/test/java/org/apache/camel/quarkus/component/openapi/java/deployment/RestRoutes.java
+++ b/extensions/openapi-java/deployment/src/test/java/org/apache/camel/quarkus/component/openapi/java/deployment/RestRoutes.java
@@ -29,8 +29,9 @@ public class RestRoutes extends RouteBuilder {
                 .description("get test")
                 .id("get")
                 .produces("text/plain")
-                .route()
-                .setBody(constant("GET: /rest"))
-                .endRest();
+                .to("direct:output");
+
+        from("direct:output")
+                .setBody().constant("GET: /rest");
     }
 }
diff --git a/extensions/openapi-java/deployment/src/test/resources/application.properties b/extensions/openapi-java/deployment/src/test/resources/application.properties
index 685ea3f..a5d206d 100644
--- a/extensions/openapi-java/deployment/src/test/resources/application.properties
+++ b/extensions/openapi-java/deployment/src/test/resources/application.properties
@@ -23,4 +23,4 @@ quarkus.camel.openapi.expose.enabled=true
 # Camel - REST
 #
 camel.rest.context-path=/camel
-camel.main.routes-include-pattern=routes/my-route.xml
+camel.main.routes-include-pattern=routes/routes.xml,routes/rests.xml
diff --git a/extensions/openapi-java/deployment/src/test/resources/routes/my-route.xml b/extensions/openapi-java/deployment/src/test/resources/routes/rests.xml
similarity index 86%
copy from extensions/openapi-java/deployment/src/test/resources/routes/my-route.xml
copy to extensions/openapi-java/deployment/src/test/resources/routes/rests.xml
index f809a04..8c2e3c1 100644
--- a/extensions/openapi-java/deployment/src/test/resources/routes/my-route.xml
+++ b/extensions/openapi-java/deployment/src/test/resources/routes/rests.xml
@@ -16,10 +16,10 @@
     limitations under the License.
 
 -->
-<rests xmlns="http://camel.apache.org/schema/spring">
+<rests>
     <rest id="camel_xml_rest" path="/xml">
         <get>
-            <route><transform><constant>Camel XML Rest</constant></transform></route>
+            <to uri="direct:outputXML" />
         </get>
     </rest>
 </rests>
diff --git a/extensions/openapi-java/deployment/src/test/resources/routes/my-route.xml b/extensions/openapi-java/deployment/src/test/resources/routes/routes.xml
similarity index 77%
rename from extensions/openapi-java/deployment/src/test/resources/routes/my-route.xml
rename to extensions/openapi-java/deployment/src/test/resources/routes/routes.xml
index f809a04..53cf194 100644
--- a/extensions/openapi-java/deployment/src/test/resources/routes/my-route.xml
+++ b/extensions/openapi-java/deployment/src/test/resources/routes/routes.xml
@@ -16,10 +16,12 @@
     limitations under the License.
 
 -->
-<rests xmlns="http://camel.apache.org/schema/spring">
-    <rest id="camel_xml_rest" path="/xml">
-        <get>
-            <route><transform><constant>Camel XML Rest</constant></transform></route>
-        </get>
-    </rest>
-</rests>
+
+<routes xmlns="http://camel.apache.org/schema/spring">
+    <route>
+        <from uri="direct:outputXML"/>
+        <setBody>
+            <constant>Camel XML Rest</constant>
+        </setBody>
+    </route>
+</routes>
diff --git a/integration-test-groups/foundation/core-fault-tolerance/src/main/resources/application.properties b/integration-test-groups/foundation/core-fault-tolerance/src/main/resources/application.properties
index 82f317f..48c4c9b 100644
--- a/integration-test-groups/foundation/core-fault-tolerance/src/main/resources/application.properties
+++ b/integration-test-groups/foundation/core-fault-tolerance/src/main/resources/application.properties
@@ -17,7 +17,7 @@
 
 #
 # Camel
-camel.faulttolerance.circuitBreakerRef = customCircuitBreaker
+camel.faulttolerance.circuitBreaker = customCircuitBreaker
 camel.faulttolerance.delay = 15
 camel.faulttolerance.successThreshold = 4
 camel.faulttolerance.requestVolumeThreshold = 60
diff --git a/integration-test-groups/foundation/stream/src/main/java/org/apache/camel/quarkus/component/stream/it/StreamResource.java b/integration-test-groups/foundation/stream/src/main/java/org/apache/camel/quarkus/component/stream/it/StreamResource.java
index 24f6ea0..462bccc 100644
--- a/integration-test-groups/foundation/stream/src/main/java/org/apache/camel/quarkus/component/stream/it/StreamResource.java
+++ b/integration-test-groups/foundation/stream/src/main/java/org/apache/camel/quarkus/component/stream/it/StreamResource.java
@@ -42,7 +42,7 @@ public class StreamResource {
     public String greetingStream(String message) throws Exception {
         try (ByteArrayOutputStream stream = new ByteArrayOutputStream()) {
             producerTemplate.sendBodyAndHeader("stream:header", message.getBytes(), "stream", stream);
-            return "Hello " + stream.toString();
+            return "Hello " + stream;
         }
     }
 }
diff --git a/integration-test-groups/foundation/stream/src/test/java/org/apache/camel/quarkus/component/stream/it/StreamTest.java b/integration-test-groups/foundation/stream/src/test/java/org/apache/camel/quarkus/component/stream/it/StreamTest.java
index 374c3c7..b8b1ab9 100644
--- a/integration-test-groups/foundation/stream/src/test/java/org/apache/camel/quarkus/component/stream/it/StreamTest.java
+++ b/integration-test-groups/foundation/stream/src/test/java/org/apache/camel/quarkus/component/stream/it/StreamTest.java
@@ -33,6 +33,6 @@ class StreamTest {
                 .body("Camel Quarkus Stream")
                 .post("/stream/post")
                 .then().statusCode(200)
-                .body(is("Hello Camel Quarkus Stream"));
+                .body(is("Hello Camel Quarkus Stream" + System.lineSeparator()));
     }
 }
diff --git a/integration-tests/google-storage/pom.xml b/integration-tests/google-storage/pom.xml
index 383f1d0..7048f87 100644
--- a/integration-tests/google-storage/pom.xml
+++ b/integration-tests/google-storage/pom.xml
@@ -68,6 +68,11 @@
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-integration-test-support-mock-backend</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-integration-test-support</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <profiles>
diff --git a/integration-tests/google-storage/src/test/java/org/apache/camel/quarkus/component/google/storage/it/GoogleStorageTestResource.java b/integration-tests/google-storage/src/test/java/org/apache/camel/quarkus/component/google/storage/it/GoogleStorageTestResource.java
index 92c6cf5..234da5c 100644
--- a/integration-tests/google-storage/src/test/java/org/apache/camel/quarkus/component/google/storage/it/GoogleStorageTestResource.java
+++ b/integration-tests/google-storage/src/test/java/org/apache/camel/quarkus/component/google/storage/it/GoogleStorageTestResource.java
@@ -20,11 +20,13 @@ import java.util.HashMap;
 import java.util.Map;
 
 import io.quarkus.test.common.QuarkusTestResourceLifecycleManager;
+import org.apache.camel.quarkus.test.AvailablePortFinder;
+import org.testcontainers.containers.FixedHostPortGenericContainer;
 import org.testcontainers.containers.GenericContainer;
 
 public class GoogleStorageTestResource implements QuarkusTestResourceLifecycleManager {
 
-    public static final int PORT = 4443;
+    public static final int PORT = AvailablePortFinder.getNextAvailable();
     public static final String CONTAINER_NAME = "fsouza/fake-gcs-server";
 
     private GenericContainer<?> container;
@@ -35,14 +37,13 @@ public class GoogleStorageTestResource implements QuarkusTestResourceLifecycleMa
         Map<String, String> properties = new HashMap<>();
 
         if (GoogleStorageHelper.usingMockBackend()) {
-
-            container = new GenericContainer<>(CONTAINER_NAME)
-                    .withExposedPorts(PORT)
+            container = new FixedHostPortGenericContainer<>(CONTAINER_NAME)
+                    .withFixedExposedPort(PORT, PORT)
                     .withCreateContainerCmdModifier(
-                            it -> it.withEntrypoint("/bin/fake-gcs-server", "-scheme", "http"));
+                            it -> it.withEntrypoint("/bin/fake-gcs-server", "-scheme", "http", "-port", String.valueOf(PORT)));
             container.start();
 
-            properties.put(GoogleStorageResource.PARAM_PORT, container.getMappedPort(PORT).toString());
+            properties.put(GoogleStorageResource.PARAM_PORT, String.valueOf(PORT));
         }
 
         return properties;
diff --git a/integration-tests/kafka/src/main/java/org/apache/camel/quarkus/component/kafka/CamelKafkaRoutes.java b/integration-tests/kafka/src/main/java/org/apache/camel/quarkus/component/kafka/CamelKafkaRoutes.java
index e460fbc..381d825 100644
--- a/integration-tests/kafka/src/main/java/org/apache/camel/quarkus/component/kafka/CamelKafkaRoutes.java
+++ b/integration-tests/kafka/src/main/java/org/apache/camel/quarkus/component/kafka/CamelKafkaRoutes.java
@@ -61,7 +61,7 @@ public class CamelKafkaRoutes extends RouteBuilder {
 
         from("direct:idempotent")
                 .idempotentConsumer(header("id"))
-                .messageIdRepositoryRef("kafkaIdempotentRepository")
+                .idempotentRepository("kafkaIdempotentRepository")
                 .to("mock:idempotent-results")
                 .end();
 
diff --git a/integration-tests/main-xml-io/src/main/resources/rests/my-rests.xml b/integration-tests/main-xml-io/src/main/resources/rests/my-rests.xml
index fcbd834..24f641f 100644
--- a/integration-tests/main-xml-io/src/main/resources/rests/my-rests.xml
+++ b/integration-tests/main-xml-io/src/main/resources/rests/my-rests.xml
@@ -19,12 +19,8 @@
 -->
 <rests xmlns="http://camel.apache.org/schema/spring">
     <rest id="greet" path="/greeting">
-        <get uri="/hello">
-            <route id="rest-route">
-                <setBody>
-                    <constant>Hello World!</constant>
-                </setBody>
-            </route>
+        <get path="/hello">
+            <to uri="direct:greet"/>
         </get>
     </rest>
 </rests>
diff --git a/integration-tests/main-xml-io/src/main/resources/routes/my-routes.xml b/integration-tests/main-xml-io/src/main/resources/routes/my-routes.xml
index 48feb17..c367467 100644
--- a/integration-tests/main-xml-io/src/main/resources/routes/my-routes.xml
+++ b/integration-tests/main-xml-io/src/main/resources/routes/my-routes.xml
@@ -24,6 +24,13 @@
             http://camel.apache.org/schema/spring
             http://camel.apache.org/schema/spring/camel-spring.xsd">
 
+    <route id="rest-route">
+        <from uri="direct:greet"/>
+        <setBody>
+            <constant>Hello World!</constant>
+        </setBody>
+    </route>
+
     <route id="my-xml-route">
         <from uri="timer:from-xml?period=3000"/>
         <setBody>
diff --git a/integration-tests/main-xml-jaxb/src/main/resources/rests/my-rests.xml b/integration-tests/main-xml-jaxb/src/main/resources/rests/my-rests.xml
index fcbd834..24f641f 100644
--- a/integration-tests/main-xml-jaxb/src/main/resources/rests/my-rests.xml
+++ b/integration-tests/main-xml-jaxb/src/main/resources/rests/my-rests.xml
@@ -19,12 +19,8 @@
 -->
 <rests xmlns="http://camel.apache.org/schema/spring">
     <rest id="greet" path="/greeting">
-        <get uri="/hello">
-            <route id="rest-route">
-                <setBody>
-                    <constant>Hello World!</constant>
-                </setBody>
-            </route>
+        <get path="/hello">
+            <to uri="direct:greet"/>
         </get>
     </rest>
 </rests>
diff --git a/integration-tests/main-xml-jaxb/src/main/resources/routes/my-routes.xml b/integration-tests/main-xml-jaxb/src/main/resources/routes/my-routes.xml
index e491c29..c3763c0 100644
--- a/integration-tests/main-xml-jaxb/src/main/resources/routes/my-routes.xml
+++ b/integration-tests/main-xml-jaxb/src/main/resources/routes/my-routes.xml
@@ -23,6 +23,13 @@
             http://camel.apache.org/schema/spring
             http://camel.apache.org/schema/spring/camel-spring.xsd">
 
+    <route id="rest-route">
+        <from uri="direct:greet"/>
+        <setBody>
+            <constant>Hello World!</constant>
+        </setBody>
+    </route>
+
     <route id="my-xml-route">
         <from uri="timer:from-xml?period=3000"/>
         <setBody>
diff --git a/integration-tests/main-xml-jaxb/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlJaxbTest.java b/integration-tests/main-xml-jaxb/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlJaxbTest.java
index 6fbbfdc..89170e5 100644
--- a/integration-tests/main-xml-jaxb/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlJaxbTest.java
+++ b/integration-tests/main-xml-jaxb/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlJaxbTest.java
@@ -80,7 +80,7 @@ public class CoreMainXmlJaxbTest {
 
     private boolean logContainsDumpedRoutes(String log) {
         return log.contains("<route customId=\"true\" id=\"my-xml-route\">") &&
-                log.contains("<route customId=\"true\" id=\"rest-route\" rest=\"true\">") &&
+                log.contains("<route customId=\"true\" id=\"rest-route\">") &&
                 log.contains("<rest customId=\"true\" id=\"greet\" path=\"/greeting\">") &&
                 log.contains("<routeTemplate customId=\"true\" id=\"myTemplate\">");
     }
diff --git a/integration-tests/main-yaml/src/main/resources/routes/my-rests.yaml b/integration-tests/main-yaml/src/main/resources/routes/my-rests.yaml
index fd1f1b6..b248831 100644
--- a/integration-tests/main-yaml/src/main/resources/routes/my-rests.yaml
+++ b/integration-tests/main-yaml/src/main/resources/routes/my-rests.yaml
@@ -16,10 +16,10 @@
 #
 
 - rest:
-    path: "/greeting"
-    verb:
-      - method: "get"
+    get:
+      - path: "/greeting"
         to: "direct:rest"
+
 - route:
     id: "rest-route"
     from:
diff --git a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/CustomHealthCheckRepository.java b/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/CustomHealthCheckRepository.java
index c54665d..2d31330 100644
--- a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/CustomHealthCheckRepository.java
+++ b/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/CustomHealthCheckRepository.java
@@ -16,12 +16,10 @@
  */
 package org.apache.camel.quarkus.component.microprofile.it.health;
 
-import java.util.Collections;
 import java.util.Map;
 import java.util.stream.Stream;
 
 import org.apache.camel.health.HealthCheck;
-import org.apache.camel.health.HealthCheckConfiguration;
 import org.apache.camel.health.HealthCheckRepository;
 import org.apache.camel.health.HealthCheckResultBuilder;
 import org.apache.camel.impl.health.AbstractHealthCheck;
@@ -44,21 +42,6 @@ public class CustomHealthCheckRepository implements HealthCheckRepository {
     }
 
     @Override
-    public void setConfigurations(Map<String, HealthCheckConfiguration> configurations) {
-        // Noop
-    }
-
-    @Override
-    public Map<String, HealthCheckConfiguration> getConfigurations() {
-        return Collections.emptyMap();
-    }
-
-    @Override
-    public void addConfiguration(String id, HealthCheckConfiguration configuration) {
-        // Noop
-    }
-
-    @Override
     public Stream<HealthCheck> stream() {
         return Stream.of(check);
     }
diff --git a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/FailingHealthCheck.java b/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/FailingHealthCheck.java
index 2d56d54..b278052 100644
--- a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/FailingHealthCheck.java
+++ b/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/FailingHealthCheck.java
@@ -25,7 +25,7 @@ public class FailingHealthCheck extends AbstractHealthCheck {
 
     public FailingHealthCheck() {
         super("failing-check");
-        getConfiguration().setEnabled(false);
+        setEnabled(false);
     }
 
     @Override
diff --git a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/FailureThresholdHealthCheck.java b/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/FailureThresholdHealthCheck.java
deleted file mode 100644
index 6fbcb6e..0000000
--- a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/FailureThresholdHealthCheck.java
+++ /dev/null
@@ -1,51 +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.quarkus.component.microprofile.it.health;
-
-import java.util.Map;
-
-import org.apache.camel.health.HealthCheckResultBuilder;
-import org.apache.camel.impl.health.AbstractHealthCheck;
-
-public final class FailureThresholdHealthCheck extends AbstractHealthCheck {
-
-    private boolean returnStatusUp = false;
-
-    public FailureThresholdHealthCheck() {
-        super("failure-threshold", "failure-threshold");
-        getConfiguration().setEnabled(false);
-        getConfiguration().setFailureThreshold(2);
-        getConfiguration().setInterval(500);
-    }
-
-    @Override
-    protected void doCall(HealthCheckResultBuilder builder, Map<String, Object> options) {
-        if (isReturnStatusUp()) {
-            builder.up();
-        } else {
-            builder.down();
-        }
-    }
-
-    public void setReturnStatusUp(boolean returnStatusUp) {
-        this.returnStatusUp = returnStatusUp;
-    }
-
-    public boolean isReturnStatusUp() {
-        return returnStatusUp;
-    }
-}
diff --git a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthResource.java b/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthResource.java
index f5392e6..1e2e297 100644
--- a/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthResource.java
+++ b/integration-tests/microprofile/src/main/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthResource.java
@@ -24,7 +24,6 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.QueryParam;
 
 import org.apache.camel.CamelContext;
-import org.apache.camel.health.HealthCheck;
 import org.apache.camel.health.HealthCheckRegistry;
 
 @Path("/microprofile-health")
@@ -52,7 +51,7 @@ public class MicroProfileHealthResource {
             @QueryParam("healthCheckEnabled") boolean isHealthCheckEnabled) {
         HealthCheckRegistry registry = camelContext.getExtension(HealthCheckRegistry.class);
         registry.getCheck(healthCheckId).ifPresent(healthCheck -> {
-            healthCheck.getConfiguration().setEnabled(isHealthCheckEnabled);
+            healthCheck.setEnabled(isHealthCheckEnabled);
             if (isHealthCheckEnabled) {
                 registry.register(healthCheck);
             } else {
@@ -60,18 +59,4 @@ public class MicroProfileHealthResource {
             }
         });
     }
-
-    @Path("/{healthCheckId}/return/status")
-    @POST
-    public void modifyHealthCheckStatus(
-            @PathParam("healthCheckId") String healthCheckId,
-            @QueryParam("returnStatusUp") boolean isReturnStatusUp) {
-        HealthCheck healthCheck = camelContext
-                .getExtension(HealthCheckRegistry.class)
-                .getCheck(healthCheckId)
-                .get();
-
-        FailureThresholdHealthCheck failureThresholdHealthCheck = (FailureThresholdHealthCheck) healthCheck;
-        failureThresholdHealthCheck.setReturnStatusUp(isReturnStatusUp);
-    }
 }
diff --git a/integration-tests/microprofile/src/main/resources/application.properties b/integration-tests/microprofile/src/main/resources/application.properties
index 4537e97..9b94638 100644
--- a/integration-tests/microprofile/src/main/resources/application.properties
+++ b/integration-tests/microprofile/src/main/resources/application.properties
@@ -26,9 +26,4 @@ quarkus.camel.metrics.enable-message-history = true
 camel.context.name = quarkus-camel-example
 
 # Prevent unwanted routes appearing in the health check output
-camel.health.config[disabledHealthRoute].parent=routes
-camel.health.config[disabledHealthRoute].enabled=false
-
-camel.health.config[checkIntervalThreshold].parent = routes
-camel.health.config[checkIntervalThreshold].interval = 100
-camel.health.config[checkIntervalThreshold].failure-threshold = 2
+camel.health.exclude-pattern = disabledHealthRoute
diff --git a/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthTest.java b/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthTest.java
index db79af1..4c24962 100644
--- a/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthTest.java
+++ b/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthTest.java
@@ -16,15 +16,10 @@
  */
 package org.apache.camel.quarkus.component.microprofile.it.health;
 
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
 import io.quarkus.test.junit.QuarkusTest;
 import io.restassured.RestAssured;
 import io.restassured.http.ContentType;
-import io.restassured.path.json.JsonPath;
 import org.apache.camel.ServiceStatus;
-import org.awaitility.Awaitility;
 import org.junit.jupiter.api.Test;
 
 import static org.hamcrest.Matchers.contains;
@@ -165,66 +160,4 @@ class MicroProfileHealthTest {
                     .statusCode(204);
         }
     }
-
-    @Test
-    public void testFailureThreshold() {
-        try {
-            RestAssured.given()
-                    .queryParam("healthCheckEnabled", "true")
-                    .post("/microprofile-health/failure-threshold")
-                    .then()
-                    .statusCode(204);
-
-            // Configured failure threshold and interval should allow the initial health state be UP
-            RestAssured.when().get("/q/health").then()
-                    .contentType(ContentType.JSON)
-                    .header("Content-Type", containsString("charset=UTF-8"))
-                    .body("status", is("UP"),
-                            "checks.findAll { it.name == 'failure-threshold' }.status.unique()", contains("UP"));
-
-            // Poll the health endpoint until the threshold / interval is exceeded and the health state transitions to DOWN
-            Awaitility.await().atMost(10, TimeUnit.SECONDS).pollDelay(50, TimeUnit.MILLISECONDS).until(() -> {
-                JsonPath result = RestAssured.when().get("/q/health").then()
-                        .contentType(ContentType.JSON)
-                        .header("Content-Type", containsString("charset=UTF-8"))
-                        .extract()
-                        .jsonPath();
-
-                String status = result.getString("status");
-                List<String> routeStatus = result.getList("checks.findAll { it.name == 'failure-threshold' }.status.unique()");
-                return status.equals("DOWN") && routeStatus.contains("DOWN");
-            });
-
-            RestAssured.given()
-                    .queryParam("returnStatusUp", true)
-                    .post("/microprofile-health/failure-threshold/return/status")
-                    .then()
-                    .statusCode(204);
-
-            // Try again with a poll delay > the failure interval and wait for the health state to transition to UP
-            Awaitility.await().atMost(10, TimeUnit.SECONDS).pollDelay(50, TimeUnit.MILLISECONDS).until(() -> {
-                JsonPath result = RestAssured.when().get("/q/health").then()
-                        .contentType(ContentType.JSON)
-                        .header("Content-Type", containsString("charset=UTF-8"))
-                        .extract()
-                        .jsonPath();
-
-                String status = result.getString("status");
-                List<String> routeStatus = result.getList("checks.findAll { it.name == 'failure-threshold' }.status.unique()");
-                return status.equals("UP") && routeStatus.contains("UP");
-            });
-        } finally {
-            RestAssured.given()
-                    .queryParam("returnStatusUp", false)
-                    .post("/microprofile-health/failure-threshold/return/status")
-                    .then()
-                    .statusCode(204);
-
-            RestAssured.given()
-                    .queryParam("healthCheckEnabled", "false")
-                    .post("/microprofile-health/failure-threshold")
-                    .then()
-                    .statusCode(204);
-        }
-    }
 }
diff --git a/integration-tests/openapi-java/src/main/java/org/apache/camel/quarkus/component/openapijava/it/OpenApiRoutes.java b/integration-tests/openapi-java/src/main/java/org/apache/camel/quarkus/component/openapijava/it/OpenApiRoutes.java
index 8e6a1e3..213bfbb 100644
--- a/integration-tests/openapi-java/src/main/java/org/apache/camel/quarkus/component/openapijava/it/OpenApiRoutes.java
+++ b/integration-tests/openapi-java/src/main/java/org/apache/camel/quarkus/component/openapijava/it/OpenApiRoutes.java
@@ -63,10 +63,7 @@ public class OpenApiRoutes extends RouteBuilder {
                 .description("Gets a list of fruits")
                 .id("list")
                 .produces(MediaType.APPLICATION_JSON)
-                .route()
-                .setBody().constant(getFruits())
-                .marshal().json()
-                .endRest()
+                .to("direct:fruits")
 
                 .get("/operation/spec")
                 .param()
@@ -101,20 +98,14 @@ public class OpenApiRoutes extends RouteBuilder {
                 .code("error")
                 .message("Response Error")
                 .endResponseMessage()
-                .route()
-                .setBody().constant("GET: /operation/spec")
-                .endRest()
+                .to("direct:echoMethodPath")
 
                 .get("/security/scopes")
                 .security("OAuth2", "scope1,scope2,scope3")
-                .route()
-                .setBody().constant("GET: /security/scopes")
-                .endRest()
+                .to("direct:echoMethodPath")
 
                 .get("/security/api/key")
-                .route()
-                .setBody().constant("GET: /security/api/key/header")
-                .endRest()
+                .to("direct:echoMethodPath")
                 .securityDefinitions()
                 .apiKey("X-API-Key", "The API key")
                 .withHeader("X-API-KEY")
@@ -122,17 +113,13 @@ public class OpenApiRoutes extends RouteBuilder {
                 .end()
 
                 .get("/security/basic/auth")
-                .route()
-                .setBody().constant("/security/basic/auth")
-                .endRest()
+                .to("direct:echoMethodPath")
                 .securityDefinitions()
                 .basicAuth("basicAuth", "Basic Authentication")
                 .end()
 
                 .get("/security/oauth2")
-                .route()
-                .setBody().constant("/security/oauth2")
-                .endRest()
+                .to("direct:echoMethodPath")
                 .securityDefinitions()
                 .oauth2("oauth2", "OAuth2 Authentication")
                 .flow("implicit")
@@ -146,29 +133,30 @@ public class OpenApiRoutes extends RouteBuilder {
         if (openApiVersion.equals("3.0.0")) {
             rest()
                     .get("/security/bearer/token")
-                    .route()
-                    .setBody().constant("/security/bearer/token")
-                    .endRest()
+                    .to("direct:echoMethodPath")
                     .securityDefinitions()
                     .bearerToken("bearerAuth", "Bearer Token Authentication")
                     .end()
 
                     .get("/security/mutual/tls")
-                    .route()
-                    .setBody().constant("/security/mutual/tls")
-                    .endRest()
+                    .to("direct:echoMethodPath")
                     .securityDefinitions()
                     .mutualTLS("mutualTLS")
                     .end()
 
                     .get("/security/openid")
-                    .route()
-                    .setBody().constant("/security/openid")
-                    .endRest()
+                    .to("direct:echoMethodPath")
                     .securityDefinitions()
                     .openIdConnect("openId", "https://secure.apache.org/fake/openid-configuration")
                     .end();
         }
+
+        from("direct:fruits")
+                .setBody().constant(getFruits())
+                .marshal().json();
+
+        from("direct:echoMethodPath")
+                .setBody().simple("${header.CamelHttpMethod}: ${header.CamelHttpPath}");
     }
 
     private Set<Fruit> getFruits() {
diff --git a/integration-tests/openapi-java/src/test/java/org/apache/camel/quarkus/component/openapijava/it/common/OpenApiTest.java b/integration-tests/openapi-java/src/test/java/org/apache/camel/quarkus/component/openapijava/it/common/OpenApiTest.java
index 4f97265..352851e 100644
--- a/integration-tests/openapi-java/src/test/java/org/apache/camel/quarkus/component/openapijava/it/common/OpenApiTest.java
+++ b/integration-tests/openapi-java/src/test/java/org/apache/camel/quarkus/component/openapijava/it/common/OpenApiTest.java
@@ -200,9 +200,7 @@ public abstract class OpenApiTest {
                 .then()
                 .contentType(ContentType.JSON)
                 .statusCode(200)
-                .body(
-                        containsString("x-camelContextId"),
-                        containsString("x-routeId"));
+                .body(containsString("x-camelContextId"));
     }
 
     @Test
diff --git a/integration-tests/platform-http/pom.xml b/integration-tests/platform-http/pom.xml
index 172b01a..ea7a162 100644
--- a/integration-tests/platform-http/pom.xml
+++ b/integration-tests/platform-http/pom.xml
@@ -33,6 +33,10 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-direct</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-platform-http</artifactId>
         </dependency>
         <dependency>
@@ -110,6 +114,19 @@
                 <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
                 <dependency>
                     <groupId>org.apache.camel.quarkus</groupId>
+                    <artifactId>camel-quarkus-direct-deployment</artifactId>
+                    <version>${project.version}</version>
+                    <type>pom</type>
+                    <scope>test</scope>
+                    <exclusions>
+                        <exclusion>
+                            <groupId>*</groupId>
+                            <artifactId>*</artifactId>
+                        </exclusion>
+                    </exclusions>
+                </dependency>
+                <dependency>
+                    <groupId>org.apache.camel.quarkus</groupId>
                     <artifactId>camel-quarkus-log-deployment</artifactId>
                     <version>${project.version}</version>
                     <type>pom</type>
diff --git a/integration-tests/platform-http/src/main/java/org/apache/camel/quarkus/component/platform/http/it/PlatformHttpRouteBuilder.java b/integration-tests/platform-http/src/main/java/org/apache/camel/quarkus/component/platform/http/it/PlatformHttpRouteBuilder.java
index 46cdad9..41a54eb 100644
--- a/integration-tests/platform-http/src/main/java/org/apache/camel/quarkus/component/platform/http/it/PlatformHttpRouteBuilder.java
+++ b/integration-tests/platform-http/src/main/java/org/apache/camel/quarkus/component/platform/http/it/PlatformHttpRouteBuilder.java
@@ -46,14 +46,16 @@ public class PlatformHttpRouteBuilder extends RouteBuilder {
 
         rest()
                 .get("/platform-http/rest-get")
-                .route()
-                .setBody(constant("GET: /rest-get"))
-                .endRest()
+                .to("direct:echoMethodPath")
                 .post("/platform-http/rest-post")
                 .consumes("text/plain").produces("text/plain")
-                .route()
-                .setBody(constant("POST: /rest-post"))
-                .endRest();
+                .to("direct:echoMethodPath");
+
+        from("direct:echoMethodPath")
+                .setBody().simple("${header.CamelHttpMethod}: ${header.CamelHttpPath}");
+
+        from("direct:greet")
+                .setBody().simple("Hello ${header.name}");
 
         from("platform-http:/platform-http/hello?httpMethodRestrict=GET").setBody(simple("Hello ${header.name}"));
         from("platform-http:/platform-http/get-post?httpMethodRestrict=GET,POST").setBody(simple("Hello ${body}"));
@@ -122,9 +124,7 @@ public class PlatformHttpRouteBuilder extends RouteBuilder {
         rest()
                 .get("/platform-http/hello-by-name/{name}")
                 .produces("text/plain")
-                .route()
-                .setBody(e -> "Hello " + e.getIn().getHeader("name", String.class))
-                .endRest();
+                .to("direct:greet");
 
         // Webhook tests
         from("platform-http:/platform-http/webhookpath")
diff --git a/integration-tests/platform-http/src/test/java/org/apache/camel/quarkus/component/http/server/it/PlatformHttpTest.java b/integration-tests/platform-http/src/test/java/org/apache/camel/quarkus/component/http/server/it/PlatformHttpTest.java
index 2060398..4868e6a 100644
--- a/integration-tests/platform-http/src/test/java/org/apache/camel/quarkus/component/http/server/it/PlatformHttpTest.java
+++ b/integration-tests/platform-http/src/test/java/org/apache/camel/quarkus/component/http/server/it/PlatformHttpTest.java
@@ -66,11 +66,11 @@ class PlatformHttpTest {
     @Test
     public void rest() throws Throwable {
         RestAssured.get("/my-context/platform-http/rest-get")
-                .then().body(equalTo("GET: /rest-get"));
+                .then().body(equalTo("GET: /my-context/platform-http/rest-get"));
         RestAssured.given()
                 .contentType("text/plain")
                 .post("/my-context/platform-http/rest-post")
-                .then().body(equalTo("POST: /rest-post"));
+                .then().body(equalTo("POST: /my-context/platform-http/rest-post"));
     }
 
     @Test
diff --git a/integration-tests/rest/pom.xml b/integration-tests/rest/pom.xml
index dc80da2..dec26a0 100644
--- a/integration-tests/rest/pom.xml
+++ b/integration-tests/rest/pom.xml
@@ -37,6 +37,10 @@
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-direct</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-http</artifactId>
         </dependency>
         <dependency>
@@ -126,6 +130,19 @@
                 </dependency>
                 <dependency>
                     <groupId>org.apache.camel.quarkus</groupId>
+                    <artifactId>camel-quarkus-direct-deployment</artifactId>
+                    <version>${project.version}</version>
+                    <type>pom</type>
+                    <scope>test</scope>
+                    <exclusions>
+                        <exclusion>
+                            <groupId>*</groupId>
+                            <artifactId>*</artifactId>
+                        </exclusion>
+                    </exclusions>
+                </dependency>
+                <dependency>
+                    <groupId>org.apache.camel.quarkus</groupId>
                     <artifactId>camel-quarkus-http-deployment</artifactId>
                     <version>${project.version}</version>
                     <type>pom</type>
diff --git a/integration-tests/rest/src/main/java/org/apache/camel/quarkus/component/rest/it/RestRoutes.java b/integration-tests/rest/src/main/java/org/apache/camel/quarkus/component/rest/it/RestRoutes.java
index 5342994..de4f92f 100644
--- a/integration-tests/rest/src/main/java/org/apache/camel/quarkus/component/rest/it/RestRoutes.java
+++ b/integration-tests/rest/src/main/java/org/apache/camel/quarkus/component/rest/it/RestRoutes.java
@@ -43,41 +43,29 @@ public class RestRoutes extends RouteBuilder {
         rest("/rest")
                 .delete()
                 .produces("text/plain")
-                .route()
-                .setBody(constant("DELETE: /rest"))
-                .endRest()
+                .to("direct:echoMethodPath")
 
                 .get()
                 .produces("text/plain")
-                .route()
-                .setBody(constant("GET: /rest"))
-                .endRest()
+                .to("direct:echoMethodPath")
 
                 .head()
-                .route()
-                .setHeader(Exchange.CONTENT_TYPE).constant("text/plain")
-                .endRest()
+                .to("direct:contentTypeText")
 
                 .patch()
                 .consumes("text/plain")
                 .produces("text/plain")
-                .route()
-                .setBody(simple("${body}: /rest"))
-                .endRest()
+                .to("direct:echoBodyPath")
 
                 .post()
                 .consumes("text/plain")
                 .produces("text/plain")
-                .route()
-                .setBody(simple("${body}: /rest"))
-                .endRest()
+                .to("direct:echoBodyPath")
 
                 .put()
                 .consumes("text/plain")
                 .produces("text/plain")
-                .route()
-                .setBody(simple("${body}: /rest"))
-                .endRest()
+                .to("direct:echoBodyPath")
 
                 .post("/validation")
                 .clientRequestValidation(true)
@@ -85,55 +73,67 @@ public class RestRoutes extends RouteBuilder {
                 .param().name("messageMiddle").type(RestParamType.body).required(true).endParam()
                 .param().name("messageEnd").type(RestParamType.header).required(true).endParam()
                 .param().name("unused").type(RestParamType.formData).required(false).endParam()
-                .route()
-                .setBody(simple("${header.messageStart} ${body} ${header.messageEnd}"))
-                .endRest()
+                .to("direct:greetWithBody")
 
                 .get("/template/{messageStart}/{messageEnd}")
-                .route()
-                .setBody(simple("${header.messageStart} ${header.messageEnd}"))
-                .endRest()
+                .to("direct:greet")
 
                 .post("/pojo/binding/json")
                 .bindingMode(RestBindingMode.json)
                 .type(Person.class)
                 .produces(MediaType.TEXT_PLAIN)
-                .route()
-                .setBody(simple("Name: ${body.firstName} ${body.lastName}, Age: ${body.age}"))
-                .setHeader(Exchange.CONTENT_TYPE, constant("text/plain"))
-                .endRest()
+                .to("direct:personString")
 
                 .get("/binding/json/producer")
-                .route()
-                .setBody(constant(PERSON_JSON))
-                .endRest()
+                .to("direct:personJson")
 
                 .post("/pojo/binding/xml")
                 .bindingMode(RestBindingMode.xml)
                 .type(Person.class)
                 .produces(MediaType.TEXT_PLAIN)
-                .route()
-                .setBody(simple("Name: ${body.firstName} ${body.lastName}, Age: ${body.age}"))
-                .setHeader(Exchange.CONTENT_TYPE, constant("text/plain"))
-                .endRest()
+                .to("direct:personString")
 
                 .get("/binding/xml/producer")
-                .route()
-                .setBody(constant(PERSON_XML))
-                .endRest()
+                .to("direct:personXml")
 
                 .post("/log")
-                .route()
-                .log("Hello ${body}")
-                .endRest()
+                .to("direct:hello")
 
                 .verb("head", "/custom/verb")
-                .route()
-                .setHeader(Exchange.CONTENT_TYPE, constant("text/plain"))
-                .endRest()
+                .to("direct:contentTypeText")
 
                 .post("/multipart/upload")
-                .route()
+                .to("direct:processAttachments");
+
+        from("direct:echoMethodPath")
+                .setBody().simple("${header.CamelHttpMethod}: ${header.CamelHttpPath}");
+
+        from("direct:echoBodyPath")
+                .setBody().simple("${body}: ${header.CamelHttpPath}");
+
+        from("direct:greetWithBody")
+                .setBody(simple("${header.messageStart} ${body} ${header.messageEnd}"));
+
+        from("direct:greet")
+                .setBody(simple("${header.messageStart} ${header.messageEnd}"));
+
+        from("direct:hello")
+                .log("Hello ${body}");
+
+        from("direct:personString")
+                .setHeader(Exchange.CONTENT_TYPE, constant("text/plain"))
+                .setBody().simple("Name: ${body.firstName} ${body.lastName}, Age: ${body.age}");
+
+        from("direct:personJson")
+                .setBody().constant(PERSON_JSON);
+
+        from("direct:personXml")
+                .setBody().constant(PERSON_XML);
+
+        from("direct:contentTypeText")
+                .setHeader(Exchange.CONTENT_TYPE).constant("text/plain");
+
+        from("direct:processAttachments")
                 .process(exchange -> {
                     AttachmentMessage attachmentMessage = exchange.getMessage(AttachmentMessage.class);
                     Map<String, DataHandler> attachments = attachmentMessage.getAttachments();
@@ -143,7 +143,6 @@ public class RestRoutes extends RouteBuilder {
                     } else {
                         exchange.getMessage().setBody("0");
                     }
-                })
-                .endRest();
+                });
     }
 }
diff --git a/integration-tests/servlet/pom.xml b/integration-tests/servlet/pom.xml
index 45737b4..36d8e71 100644
--- a/integration-tests/servlet/pom.xml
+++ b/integration-tests/servlet/pom.xml
@@ -33,7 +33,11 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-servlet</artifactId>
+            <artifactId>camel-quarkus-core-cloud</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-direct</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
@@ -41,7 +45,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core-cloud</artifactId>
+            <artifactId>camel-quarkus-servlet</artifactId>
         </dependency>
 
         <!-- test dependencies -->
@@ -110,6 +114,19 @@
                 </dependency>
                 <dependency>
                     <groupId>org.apache.camel.quarkus</groupId>
+                    <artifactId>camel-quarkus-direct-deployment</artifactId>
+                    <version>${project.version}</version>
+                    <type>pom</type>
+                    <scope>test</scope>
+                    <exclusions>
+                        <exclusion>
+                            <groupId>*</groupId>
+                            <artifactId>*</artifactId>
+                        </exclusion>
+                    </exclusions>
+                </dependency>
+                <dependency>
+                    <groupId>org.apache.camel.quarkus</groupId>
                     <artifactId>camel-quarkus-rest-deployment</artifactId>
                     <version>${project.version}</version>
                     <type>pom</type>
diff --git a/integration-tests/servlet/src/main/java/org/apache/camel/quarkus/component/servlet/CamelRoute.java b/integration-tests/servlet/src/main/java/org/apache/camel/quarkus/component/servlet/CamelRoute.java
index 0730289..933e426 100644
--- a/integration-tests/servlet/src/main/java/org/apache/camel/quarkus/component/servlet/CamelRoute.java
+++ b/integration-tests/servlet/src/main/java/org/apache/camel/quarkus/component/servlet/CamelRoute.java
@@ -18,6 +18,8 @@ package org.apache.camel.quarkus.component.servlet;
 
 import javax.enterprise.context.ApplicationScoped;
 
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
 
 @ApplicationScoped
@@ -33,13 +35,10 @@ public class CamelRoute extends RouteBuilder {
 
         rest()
                 .get("/rest-get")
-                .route()
-                .setBody(constant("GET: /rest-get"))
-                .endRest()
+                .to("direct:echoMethodPath")
+
                 .post("/rest-post")
-                .route()
-                .setBody(constant("POST: /rest-post"))
-                .endRest();
+                .to("direct:echoMethodPath");
 
         from("servlet://hello?matchOnUriPrefix=true")
                 .setBody(constant("GET: /hello"));
@@ -50,6 +49,14 @@ public class CamelRoute extends RouteBuilder {
         from("servlet://favorite?servletName=my-favorite-servlet")
                 .setBody(constant("GET: /favorite"));
 
+        from("direct:echoMethodPath")
+                .process(new Processor() {
+                    @Override
+                    public void process(Exchange exchange) throws Exception {
+                        exchange.toString();
+                    }
+                })
+                .setBody().simple("${header.CamelHttpMethod}: ${header.CamelServletContextPath}");
     }
 
 }
diff --git a/pom.xml b/pom.xml
index c3b52e1..0ed1e06 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.camel</groupId>
         <artifactId>camel-dependencies</artifactId>
-        <version>3.15.0</version>
+        <version>3.16.0-SNAPSHOT</version>
     </parent>
 
     <groupId>org.apache.camel.quarkus</groupId>
@@ -39,8 +39,8 @@
     <properties>
 
         <!-- Primary dependencies - maintained manually -->
-        <camel.major.minor>3.15</camel.major.minor> <!-- run after each change: cd docs && mvnd validate -->
-        <camel.version>${camel.major.minor}.0</camel.version>
+        <camel.major.minor>3.16</camel.major.minor> <!-- run after each change: cd docs && mvnd validate -->
+        <camel.version>${camel.major.minor}.0-SNAPSHOT</camel.version>
         <camel.docs.components.version>${camel.major.minor}.x</camel.docs.components.version><!-- the version in Camel's docs/components/antora.yml -->
         <camel.docs.components.xref>${camel.docs.components.version}@components</camel.docs.components.xref><!-- the version in Camel's docs/components/antora.yml -->
         <camel.docs.branch>camel-${camel.major.minor}.x</camel.docs.branch><!-- The stable camel branch on which our Antora docs depends -->

[camel-quarkus] 02/03: Test for Debezium mysql - passing additionalProperties results in wrong properties beeing passed #3488

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch camel-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit 7bbd7cc3e1d057d9a3b5b491ae6c458ec669dacd
Author: JiriOndrusek <on...@gmail.com>
AuthorDate: Mon Feb 21 15:51:05 2022 +0100

    Test for Debezium mysql - passing additionalProperties results in wrong properties beeing passed #3488
---
 .../common/it/AbstractDebeziumResource.java        | 29 +++++++++++++++++++++-
 .../common/it/postgres/DebeziumPostgresTest.java   | 15 +++++++++++
 2 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/integration-tests/debezium/src/main/java/org/apache/camel/quarkus/component/debezium/common/it/AbstractDebeziumResource.java b/integration-tests/debezium/src/main/java/org/apache/camel/quarkus/component/debezium/common/it/AbstractDebeziumResource.java
index ff49301..0e74a9b 100644
--- a/integration-tests/debezium/src/main/java/org/apache/camel/quarkus/component/debezium/common/it/AbstractDebeziumResource.java
+++ b/integration-tests/debezium/src/main/java/org/apache/camel/quarkus/component/debezium/common/it/AbstractDebeziumResource.java
@@ -16,11 +16,20 @@
  */
 package org.apache.camel.quarkus.component.debezium.common.it;
 
+import java.util.Map;
+import java.util.stream.Collectors;
+
 import javax.inject.Inject;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.ConsumerTemplate;
 import org.apache.camel.Exchange;
 import org.apache.camel.component.debezium.DebeziumConstants;
+import org.apache.camel.component.debezium.DebeziumEndpoint;
 import org.eclipse.microprofile.config.Config;
 import org.eclipse.microprofile.config.inject.ConfigProperty;
 
@@ -41,10 +50,23 @@ public abstract class AbstractDebeziumResource {
     @Inject
     Config config;
 
+    @Inject
+    CamelContext camelContext;
+
     public AbstractDebeziumResource(Type type) {
         this.type = type;
     }
 
+    @Path("/getAdditionalProperties")
+    @GET
+    @Produces(MediaType.APPLICATION_JSON)
+    public Map<String, String> getAdditionalProperties() {
+        DebeziumEndpoint endpoint = (DebeziumEndpoint) camelContext.getEndpoint(getEndpointUrl()
+                + "&additionalProperties.database.connectionTimeZone=CET");
+        return endpoint.getConfiguration().getAdditionalProperties().entrySet().stream()
+                .collect(Collectors.toMap(Map.Entry::getKey, e -> (String) e.getValue()));
+    }
+
     String getEndpoinUrl(String hostname, String port, String username, String password, String databaseServerName,
             String offsetStorageFileName) {
         return type.getComponent() + ":localhost?"
@@ -90,6 +112,11 @@ public abstract class AbstractDebeziumResource {
     }
 
     private Exchange receiveAsExchange() {
+        String endpoint = getEndpointUrl();
+        return consumerTemplate.receive(endpoint, TIMEOUT);
+    }
+
+    protected String getEndpointUrl() {
         String endpoint = getEndpoinUrl(
                 config.getValue(type.getPropertyHostname(), String.class),
                 config.getValue(type.getPropertyPort(), String.class),
@@ -97,6 +124,6 @@ public abstract class AbstractDebeziumResource {
                 config.getValue(type.getPropertyPassword(), String.class),
                 "qa",
                 config.getValue(type.getPropertyOffsetFileName(), String.class));
-        return consumerTemplate.receive(endpoint, TIMEOUT);
+        return endpoint;
     }
 }
diff --git a/integration-tests/debezium/src/test/java/org/apache/camel/quarkus/component/debezium/common/it/postgres/DebeziumPostgresTest.java b/integration-tests/debezium/src/test/java/org/apache/camel/quarkus/component/debezium/common/it/postgres/DebeziumPostgresTest.java
index c610735..4a7148a 100644
--- a/integration-tests/debezium/src/test/java/org/apache/camel/quarkus/component/debezium/common/it/postgres/DebeziumPostgresTest.java
+++ b/integration-tests/debezium/src/test/java/org/apache/camel/quarkus/component/debezium/common/it/postgres/DebeziumPostgresTest.java
@@ -22,6 +22,7 @@ import java.sql.SQLException;
 
 import io.quarkus.test.common.QuarkusTestResource;
 import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
 import org.apache.camel.quarkus.component.debezium.common.it.AbstractDebeziumTest;
 import org.apache.camel.quarkus.component.debezium.common.it.Type;
 import org.eclipse.microprofile.config.Config;
@@ -30,8 +31,12 @@ import org.jboss.logging.Logger;
 import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.MethodOrderer;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.TestMethodOrder;
 
+import static org.hamcrest.Matchers.is;
+
 @QuarkusTest
 @QuarkusTestResource(DebeziumPostgresTestResource.class)
 @TestMethodOrder(MethodOrderer.OrderAnnotation.class)
@@ -51,6 +56,16 @@ class DebeziumPostgresTest extends AbstractDebeziumTest {
         connection = DriverManager.getConnection(jdbcUrl);
     }
 
+    @Test
+    @Order(4)
+    public void testAdditionalProperty() {
+        //https://github.com/apache/camel-quarkus/issues/3488
+        RestAssured.get(Type.postgres.getComponent() + "/getAdditionalProperties")
+                .then()
+                .statusCode(200)
+                .body("'database.connectionTimeZone'", is("CET"));
+    }
+
     @AfterAll
     public static void cleanUp() throws SQLException {
         if (connection != null) {