You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2019/10/05 10:05:09 UTC

[camel-quarkus] branch master updated (9232f3c -> 152559e)

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

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


    from 9232f3c  Merge pull request #225 from lburgazzoli/substitutions
     new b6b5777  Fix failing MicroProfile metrics tests
     new 9607e9b  Remove custom registry implementation #198
     new 2677016  Use MainSupport as base for running Camel #9
     new 23359bd  integrate main support in camel-quarkus-core
     new c23864c  inline BeanManagerHelper in RuntimeBeanRepository #9
     new 152559e  remove redunand dependency on camel-quarkus-core from integration tests #9

The 6 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:
 .../quarkus/core/deployment/BuildProcessor.java    | 257 ++++++++-------------
 ...meBuildItem.java => CamelContextBuildItem.java} |  18 +-
 ...ntimeBuildItem.java => CamelMainBuildItem.java} |  18 +-
 ...ldItem.java => CamelMainListenerBuildItem.java} |  22 +-
 ...eBuildItem.java => CamelRegistryBuildItem.java} |  18 +-
 ...dItem.java => CamelRoutesBuilderBuildItem.java} |  19 +-
 .../quarkus/core/deployment/CamelSupport.java      |  80 +++++++
 .../core/deployment/HotDeploymentProcessor.java    |   2 +-
 .../core/deployment/SubstrateProcessor.java        | 166 +++++++------
 .../quarkus/core/deployment/XmlProcessor.java      |   2 +-
 .../devmode/CamelHotReplacementSetup.java          |   1 -
 extensions/core/runtime/pom.xml                    |   6 +-
 .../quarkus/core/{runtime => }/CamelConfig.java    |  25 +-
 .../org/apache/camel/quarkus/core/CamelMain.java   |  81 +++++++
 .../quarkus/core/CamelMainEventDispatcher.java     |  55 +++++
 .../apache/camel/quarkus/core/CamelMainEvents.java |  37 ++-
 .../camel/quarkus/core/CamelMainProducers.java     |  21 +-
 .../camel/quarkus/core/CamelMainRecorder.java      | 118 ++++++++++
 .../quarkus/core/{runtime => }/CamelProducers.java |  45 ++--
 .../apache/camel/quarkus/core/CamelRecorder.java   |  87 +++++++
 .../{runtime/support => }/FastCamelContext.java    |  81 ++++---
 .../core/{runtime/support => }/FastModel.java      |   3 +-
 .../{runtime/support => }/FastUuidGenerator.java   |   2 +-
 .../quarkus/core/{runtime/support => }/Flags.java  |   8 +-
 .../{runtime/support => }/NoShutdownStrategy.java  |   2 +-
 ...nagerHelper.java => RuntimeBeanRepository.java} |  49 ++--
 .../apache/camel/quarkus/core/RuntimeRegistry.java |  19 +-
 .../{runtime => }/graal/SubstituteHostUtils.java   |   2 +-
 .../graal/SubstituteIntrospectionSupport.java      |   2 +-
 .../camel/quarkus/core/runtime/CamelRecorder.java  | 103 ---------
 .../camel/quarkus/core/runtime/CamelRuntime.java   |  48 ----
 .../quarkus/core/runtime/InitializedEvent.java     |  21 --
 .../quarkus/core/runtime/InitializingEvent.java    |  21 --
 .../camel/quarkus/core/runtime/StartedEvent.java   |  21 --
 .../camel/quarkus/core/runtime/StartingEvent.java  |  21 --
 .../camel/quarkus/core/runtime/StoppedEvent.java   |  21 --
 .../camel/quarkus/core/runtime/StoppingEvent.java  |  21 --
 .../core/runtime/support/FastCamelRuntime.java     | 252 --------------------
 .../core/runtime/support/RuntimeRegistry.java      | 112 ---------
 .../http/deployment/PlatformHttpProcessor.java     |   7 +-
 .../http/runtime/PlatformHttpRecorder.java         |  13 +-
 .../test/CustomDefaultServletClassTest.java        |  35 ++-
 .../component/servlet/test/MinimalConfigTest.java  |  32 ++-
 .../servlet/test/NoDefaultServletTest.java         |  33 ++-
 .../quarkus/component/bean/CamelResource.java      |   3 +-
 .../component/core/cdi/CamelApplication.java       |  80 -------
 .../quarkus/component/core/cdi/CamelServlet.java   |  66 ------
 .../core-cdi/src/main/resources/hello.xml          |  27 ---
 .../quarkus/component/core/cdi/CamelITCase.java    |  23 --
 .../quarkus/component/core/cdi/CamelTest.java      |  49 ----
 integration-tests/core-impl/pom.xml                |   6 +-
 .../src/main/resources/application.properties      |   1 +
 .../core-main}/deployment/pom.xml                  |  12 +-
 .../core/runtime}/support/deployment/Feature.java  |   4 +-
 .../support/deployment/SupportBuildStep.java       |  15 +-
 integration-tests/{core => core-main}/pom.xml      |   6 +-
 .../{core => core-main}/runtime/pom.xml            |  10 +-
 .../core/runtime/support/SupportListener.java      |  56 +++++
 .../{core-cdi => core-main/test}/pom.xml           |  23 +-
 .../org/apache/camel/quarkus/core/CamelRoute.java  |   8 +-
 .../apache/camel/quarkus/core/CamelServlet.java    |  56 +++--
 .../test/src/main/resources/application.properties |   6 +-
 .../org/apache/camel/quarkus/core/CamelITCase.java |   0
 .../org/apache/camel/quarkus/core/CamelTest.java   |  50 ++--
 integration-tests/core/test/pom.xml                |   4 -
 .../apache/camel/quarkus/core/CamelServlet.java    |  74 ++----
 .../test/src/main/resources/application.properties |  11 +-
 .../org/apache/camel/quarkus/core/CamelTest.java   |  42 +---
 integration-tests/infinispan/pom.xml               |  17 +-
 .../quarkus/component/infinispan/CamelRoute.java   |  32 +--
 .../component/infinispan/CamelServlet.java}        |  23 +-
 .../src/main/resources/application.properties      |  15 +-
 ...{CamelInfinispanITCase.java => CamelTCase.java} |   2 +-
 .../{CamelInfinispanTest.java => CamelTest.java}   |  21 +-
 .../infinispan/InfinispanServerTestResource.java   |  22 +-
 .../camel/quarkus/component/mail/CamelRoute.java   |  10 +-
 .../mail/src/main/resources/application.properties |   1 -
 .../camel/quarkus/component/mail/MailTest.java     |  32 +--
 integration-tests/microprofile-metrics/pom.xml     |   4 +
 .../metrics/it/MicroProfileMetricsResource.java    |   7 +
 .../metrics/it/MicroProfileMetricsTest.java        |  68 +++---
 integration-tests/netty-http/pom.xml               |   4 -
 .../src/main/resources/application.properties      |   9 +-
 .../src/main/resources/application.properties      |   4 -
 integration-tests/pom.xml                          |   2 +-
 .../quarkus/component/salesforce/CamelServlet.java |   4 +-
 pom.xml                                            |   2 +-
 poms/bom/pom.xml                                   |  10 +-
 88 files changed, 1288 insertions(+), 1640 deletions(-)
 copy extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/{CamelRuntimeBuildItem.java => CamelContextBuildItem.java} (70%)
 copy extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/{CamelRuntimeBuildItem.java => CamelMainBuildItem.java} (71%)
 copy extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/{CamelRuntimeBuildItem.java => CamelMainListenerBuildItem.java} (63%)
 copy extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/{CamelRuntimeBuildItem.java => CamelRegistryBuildItem.java} (71%)
 rename extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/{CamelRuntimeBuildItem.java => CamelRoutesBuilderBuildItem.java} (64%)
 rename extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/{runtime => }/CamelConfig.java (87%)
 create mode 100644 extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMain.java
 create mode 100644 extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainEventDispatcher.java
 copy integration-tests/core/test/src/main/java/org/apache/camel/quarkus/core/CamelRoute.java => extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainEvents.java (52%)
 copy integration-tests/core/test/src/main/java/org/apache/camel/quarkus/core/CamelRoute.java => extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainProducers.java (73%)
 create mode 100644 extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainRecorder.java
 rename extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/{runtime => }/CamelProducers.java (54%)
 create mode 100644 extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelRecorder.java
 rename extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/{runtime/support => }/FastCamelContext.java (84%)
 rename extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/{runtime/support => }/FastModel.java (99%)
 rename extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/{runtime/support => }/FastUuidGenerator.java (96%)
 rename extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/{runtime/support => }/Flags.java (82%)
 rename extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/{runtime/support => }/NoShutdownStrategy.java (98%)
 rename extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/{runtime/support/BeanManagerHelper.java => RuntimeBeanRepository.java} (55%)
 copy integration-tests/core/test/src/main/java/org/apache/camel/quarkus/core/CamelRoute.java => extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/RuntimeRegistry.java (69%)
 rename extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/{runtime => }/graal/SubstituteHostUtils.java (95%)
 rename extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/{runtime => }/graal/SubstituteIntrospectionSupport.java (96%)
 delete mode 100644 extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRecorder.java
 delete mode 100644 extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRuntime.java
 delete mode 100644 extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/InitializedEvent.java
 delete mode 100644 extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/InitializingEvent.java
 delete mode 100644 extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/StartedEvent.java
 delete mode 100644 extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/StartingEvent.java
 delete mode 100644 extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/StoppedEvent.java
 delete mode 100644 extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/StoppingEvent.java
 delete mode 100644 extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelRuntime.java
 delete mode 100644 extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/RuntimeRegistry.java
 delete mode 100644 integration-tests/core-cdi/src/main/java/org/apache/camel/quarkus/component/core/cdi/CamelApplication.java
 delete mode 100644 integration-tests/core-cdi/src/main/java/org/apache/camel/quarkus/component/core/cdi/CamelServlet.java
 delete mode 100644 integration-tests/core-cdi/src/main/resources/hello.xml
 delete mode 100644 integration-tests/core-cdi/src/test/java/org/apache/camel/quarkus/component/core/cdi/CamelITCase.java
 delete mode 100644 integration-tests/core-cdi/src/test/java/org/apache/camel/quarkus/component/core/cdi/CamelTest.java
 copy {extensions/mail => integration-tests/core-main}/deployment/pom.xml (82%)
 copy integration-tests/{core/deployment/src/main/java/org/apache/camel/quarkus/core => core-main/deployment/src/main/java/org/apache/camel/quarkus/core/runtime}/support/deployment/Feature.java (88%)
 copy extensions/netty-http/deployment/src/main/java/org/apache/camel/quarkus/component/netty/http/deployment/NettyHTTPProcessor.java => integration-tests/core-main/deployment/src/main/java/org/apache/camel/quarkus/core/runtime/support/deployment/SupportBuildStep.java (66%)
 copy integration-tests/{core => core-main}/pom.xml (91%)
 copy integration-tests/{core => core-main}/runtime/pom.xml (87%)
 create mode 100644 integration-tests/core-main/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/SupportListener.java
 rename integration-tests/{core-cdi => core-main/test}/pom.xml (87%)
 copy integration-tests/{core => core-main}/test/src/main/java/org/apache/camel/quarkus/core/CamelRoute.java (89%)
 copy integration-tests/{core => core-main}/test/src/main/java/org/apache/camel/quarkus/core/CamelServlet.java (66%)
 copy integration-tests/{core => core-main}/test/src/main/resources/application.properties (95%)
 copy integration-tests/{core => core-main}/test/src/test/java/org/apache/camel/quarkus/core/CamelITCase.java (100%)
 copy integration-tests/{core => core-main}/test/src/test/java/org/apache/camel/quarkus/core/CamelTest.java (69%)
 copy integration-tests/{bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelResource.java => infinispan/src/main/java/org/apache/camel/quarkus/component/infinispan/CamelServlet.java} (73%)
 rename integration-tests/{core-cdi => infinispan}/src/main/resources/application.properties (85%)
 rename integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/{CamelInfinispanITCase.java => CamelTCase.java} (93%)
 rename integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/{CamelInfinispanTest.java => CamelTest.java} (70%)


[camel-quarkus] 04/06: integrate main support in camel-quarkus-core

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

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

commit 23359bde170cab70af02b1933d14aebfe73bc08b
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Fri Oct 4 21:43:12 2019 +0200

    integrate main support in camel-quarkus-core
---
 .../ROOT/pages/_partials/component-extensions.adoc |   1 -
 .../quarkus/core/deployment/BuildProcessor.java    | 144 +++++++++++++------
 .../core}/deployment/CamelMainBuildItem.java       |   7 +-
 .../deployment/CamelMainListenerBuildItem.java     |   4 +-
 .../deployment/CamelRoutesBuilderBuildItem.java}   |  21 +--
 .../core/deployment/HotDeploymentProcessor.java    |   2 +-
 .../core/deployment/SubstrateProcessor.java        | 160 ++++++++++++---------
 .../quarkus/core/deployment/XmlProcessor.java      |   2 +-
 .../devmode/CamelHotReplacementSetup.java          |   1 -
 extensions/core/runtime/pom.xml                    |   4 +
 .../{runtime/support => }/BeanManagerHelper.java   |   2 +-
 .../quarkus/core/{runtime => }/CamelConfig.java    |  25 ++--
 .../org/apache/camel/quarkus/core}/CamelMain.java  |   4 +-
 .../quarkus/core}/CamelMainEventDispatcher.java    |   2 +-
 .../camel/quarkus/core}/CamelMainEvents.java       |   2 +-
 .../camel/quarkus/core}/CamelMainProducers.java    |   2 +-
 .../camel/quarkus/core}/CamelMainRecorder.java     |  43 +++++-
 .../quarkus/core/{runtime => }/CamelProducers.java |   2 +-
 .../quarkus/core/{runtime => }/CamelRecorder.java  |   5 +-
 .../{runtime/support => }/FastCamelContext.java    |   4 +-
 .../core/{runtime/support => }/FastModel.java      |   2 +-
 .../{runtime/support => }/FastUuidGenerator.java   |   2 +-
 .../quarkus/core/{runtime/support => }/Flags.java  |   8 +-
 .../{runtime/support => }/NoShutdownStrategy.java  |   2 +-
 .../support => }/RuntimeBeanRepository.java        |   2 +-
 .../{runtime/support => }/RuntimeRegistry.java     |   2 +-
 .../{runtime => }/graal/SubstituteHostUtils.java   |   2 +-
 .../graal/SubstituteIntrospectionSupport.java      |   2 +-
 extensions/main/deployment/pom.xml                 |  73 ----------
 .../quarkus/main/deployment/BuildProcessor.java    |  77 ----------
 .../camel/quarkus/main/deployment/Feature.java     |  29 ----
 .../main/deployment/SubstrateProcessor.java        |  51 -------
 extensions/main/pom.xml                            |  39 -----
 extensions/main/runtime/pom.xml                    |  78 ----------
 extensions/pom.xml                                 |   1 -
 .../test/CustomDefaultServletClassTest.java        |  16 +--
 .../component/servlet/test/MinimalConfigTest.java  |  13 +-
 .../servlet/test/NoDefaultServletTest.java         |  16 +--
 integration-tests/aws/pom.xml                      |   2 +-
 integration-tests/bean/pom.xml                     |   2 +-
 integration-tests/core-impl/pom.xml                |   2 +-
 .../src/main/resources/application.properties      |   1 +
 .../{main => core-main}/deployment/pom.xml         |  12 +-
 .../core/runtime}/support/deployment/Feature.java  |   2 +-
 .../support/deployment/SupportBuildStep.java       |   6 +-
 integration-tests/{main => core-main}/pom.xml      |   6 +-
 .../{main => core-main}/runtime/pom.xml            |  10 +-
 .../core/runtime}/support/SupportListener.java     |   2 +-
 integration-tests/{main => core-main}/test/pom.xml |  10 +-
 .../org/apache/camel/quarkus/core}/CamelRoute.java |   2 +-
 .../apache/camel/quarkus/core}/CamelServlet.java   |   3 +-
 .../test/src/main/resources/application.properties |   0
 .../apache/camel/quarkus/core}/CamelITCase.java    |   2 +-
 .../org/apache/camel/quarkus/core}/CamelTest.java  |   4 +-
 .../apache/camel/quarkus/core/CamelServlet.java    |   7 +
 .../test/src/main/resources/application.properties |   1 +
 .../org/apache/camel/quarkus/core/CamelTest.java   |   1 +
 integration-tests/csv/pom.xml                      |   2 +-
 integration-tests/infinispan/pom.xml               |   2 +-
 .../quarkus/component/infinispan/CamelTest.java    |   2 +-
 integration-tests/jdbc/pom.xml                     |   2 +-
 integration-tests/mail/pom.xml                     |   2 +-
 integration-tests/microprofile-metrics/pom.xml     |   2 +-
 integration-tests/netty-http/pom.xml               |   2 +-
 integration-tests/paho/pom.xml                     |   2 +-
 integration-tests/platform-http/pom.xml            |   2 +-
 integration-tests/pom.xml                          |   2 +-
 integration-tests/salesforce/pom.xml               |   2 +-
 integration-tests/servlet/pom.xml                  |   2 +-
 integration-tests/twitter/pom.xml                  |   2 +-
 integration-tests/zipfile/pom.xml                  |   2 +-
 poms/bom-deployment/pom.xml                        |   5 -
 poms/bom/pom.xml                                   |   5 -
 73 files changed, 362 insertions(+), 603 deletions(-)

diff --git a/docs/modules/ROOT/pages/_partials/component-extensions.adoc b/docs/modules/ROOT/pages/_partials/component-extensions.adoc
index b4462be..0481b4d 100644
--- a/docs/modules/ROOT/pages/_partials/component-extensions.adoc
+++ b/docs/modules/ROOT/pages/_partials/component-extensions.adoc
@@ -10,7 +10,6 @@
 * `camel-quarkus-jdbc`
 * `camel-quarkus-log`
 * `camel-quarkus-mail`
-* `camel-quarkus-main`
 * `camel-quarkus-microprofile-metrics`
 * `camel-quarkus-netty-http`
 * `camel-quarkus-paho`
diff --git a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/BuildProcessor.java b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/BuildProcessor.java
index 0b8b903..1145f63 100644
--- a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/BuildProcessor.java
+++ b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/BuildProcessor.java
@@ -18,7 +18,6 @@ package org.apache.camel.quarkus.core.deployment;
 
 import java.util.List;
 import java.util.Objects;
-import javax.inject.Inject;
 
 import io.quarkus.arc.deployment.AdditionalBeanBuildItem;
 import io.quarkus.arc.deployment.BeanContainerBuildItem;
@@ -28,11 +27,17 @@ import io.quarkus.deployment.annotations.ExecutionTime;
 import io.quarkus.deployment.annotations.Record;
 import io.quarkus.deployment.builditem.ApplicationArchivesBuildItem;
 import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.ServiceStartBuildItem;
+import io.quarkus.deployment.builditem.ShutdownContextBuildItem;
 import io.quarkus.runtime.RuntimeValue;
 import org.apache.camel.CamelContext;
-import org.apache.camel.quarkus.core.runtime.CamelConfig;
-import org.apache.camel.quarkus.core.runtime.CamelProducers;
-import org.apache.camel.quarkus.core.runtime.CamelRecorder;
+import org.apache.camel.quarkus.core.CamelConfig;
+import org.apache.camel.quarkus.core.CamelMain;
+import org.apache.camel.quarkus.core.CamelMainProducers;
+import org.apache.camel.quarkus.core.CamelMainRecorder;
+import org.apache.camel.quarkus.core.CamelProducers;
+import org.apache.camel.quarkus.core.CamelRecorder;
+import org.apache.camel.quarkus.core.Flags;
 import org.apache.camel.spi.Registry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -40,63 +45,118 @@ import org.slf4j.LoggerFactory;
 class BuildProcessor {
     private static final Logger LOGGER = LoggerFactory.getLogger(BuildProcessor.class);
 
-    @Inject
-    ApplicationArchivesBuildItem applicationArchivesBuildItem;
-    @Inject
-    CombinedIndexBuildItem combinedIndexBuildItem;
+    /*
+     * Build steps related to camel core.
+     */
+    public static class Core {
+        @BuildStep
+        void beans(BuildProducer<AdditionalBeanBuildItem> beanProducer) {
+            beanProducer.produce(AdditionalBeanBuildItem.unremovableOf(CamelProducers.class));
+        }
 
-    @Record(ExecutionTime.STATIC_INIT)
-    @BuildStep
-    CamelRegistryBuildItem registry(
+        @Record(ExecutionTime.STATIC_INIT)
+        @BuildStep
+        CamelRegistryBuildItem registry(
             CamelRecorder recorder,
+            ApplicationArchivesBuildItem applicationArchives,
             List<CamelBeanBuildItem> registryItems) {
 
-        RuntimeValue<Registry> registry = recorder.createRegistry();
+            RuntimeValue<Registry> registry = recorder.createRegistry();
+
+            CamelSupport.services(applicationArchives).filter(
+                si -> registryItems.stream().noneMatch(
+                    c -> Objects.equals(si.name, c.getName()) && c.getType().isAssignableFrom(si.type)
+                )
+            ).forEach(
+                si -> {
+                    LOGGER.debug("Binding camel service {} with type {}", si.name, si.type);
+
+                    recorder.bind(
+                        registry,
+                        si.name,
+                        si.type
+                    );
+                }
+            );
 
-        CamelSupport.services(applicationArchivesBuildItem).filter(
-            si -> registryItems.stream().noneMatch(
-                c -> Objects.equals(si.name, c.getName()) && c.getType().isAssignableFrom(si.type)
-            )
-        ).forEach(
-            si -> {
-                LOGGER.debug("Binding camel service {} with type {}", si.name, si.type);
+            for (CamelBeanBuildItem item : registryItems) {
+                LOGGER.debug("Binding item with name: {}, type {}", item.getName(), item.getType());
 
                 recorder.bind(
                     registry,
-                    si.name,
-                    si.type
+                    item.getName(),
+                    item.getType(),
+                    item.getValue()
                 );
             }
-        );
-
-        for (CamelBeanBuildItem item: registryItems) {
-            LOGGER.debug("Binding item with name: {}, type {}", item.getName(), item.getType());
 
-            recorder.bind(
-                registry,
-                item.getName(),
-                item.getType(),
-                item.getValue()
-            );
+            return new CamelRegistryBuildItem(registry);
         }
 
-        return new CamelRegistryBuildItem(registry);
-    }
-
-    @Record(ExecutionTime.STATIC_INIT)
-    @BuildStep
-    CamelContextBuildItem context(
+        @Record(ExecutionTime.STATIC_INIT)
+        @BuildStep
+        CamelContextBuildItem context(
             CamelRecorder recorder,
             CamelRegistryBuildItem registry,
             BeanContainerBuildItem beanContainer,
             CamelConfig.BuildTime buildTimeConfig) {
 
-        RuntimeValue<CamelContext> context = recorder.createContext(registry.getRegistry(), beanContainer.getValue(), buildTimeConfig);
-        return new CamelContextBuildItem(context);
+            RuntimeValue<CamelContext> context = recorder.createContext(registry.getRegistry(), beanContainer.getValue(), buildTimeConfig);
+            return new CamelContextBuildItem(context);
+        }
     }
 
-    @BuildStep
-    void beans(BuildProducer<AdditionalBeanBuildItem> beanProducer) {
-        beanProducer.produce(AdditionalBeanBuildItem.unremovableOf(CamelProducers.class));
+    /*
+     * Build steps related to camel main that are activated by default but can be
+     * disabled by setting quarkus.camel.disable-main = true
+     */
+    public static class Main {
+
+        @BuildStep(onlyIfNot = Flags.MainDisabled.class)
+        void beans(BuildProducer<AdditionalBeanBuildItem> beanProducer) {
+            beanProducer.produce(AdditionalBeanBuildItem.unremovableOf(CamelMainProducers.class));
+        }
+
+        @Record(ExecutionTime.STATIC_INIT)
+        @BuildStep(onlyIfNot = Flags.MainDisabled.class)
+        CamelMainBuildItem main(
+            CombinedIndexBuildItem combinedIndex,
+            CamelMainRecorder recorder,
+            CamelContextBuildItem context,
+            List<CamelMainListenerBuildItem> listeners,
+            List<CamelRoutesBuilderBuildItem> routesBuilders,
+            BeanContainerBuildItem beanContainer,
+            CamelConfig.BuildTime buildTimeConfig) {
+
+            RuntimeValue<CamelMain> main = recorder.createCamelMain(context.getCamelContext(), beanContainer.getValue());
+            for (CamelMainListenerBuildItem listener : listeners) {
+                recorder.addListener(main, listener.getListener());
+            }
+
+            CamelSupport.getRouteBuilderClasses(combinedIndex.getIndex()).forEach(name -> {
+                recorder.addRouteBuilder(main, name);
+            });
+            routesBuilders.forEach(routesBuilder -> {
+                recorder.addRouteBuilder(main, routesBuilder.getInstance());
+            });
+            buildTimeConfig.routesUris.forEach(location -> {
+                recorder.addRoutesFromLocation(main, location);
+            });
+
+            return new CamelMainBuildItem(main);
+        }
+
+        @Record(ExecutionTime.RUNTIME_INIT)
+        @BuildStep(onlyIfNot = Flags.MainDisabled.class)
+        void start(
+            CamelMainRecorder recorder,
+            CamelMainBuildItem main,
+            ShutdownContextBuildItem shutdown,
+            // TODO: keep this list as placeholder to ensure the ArC container is fully
+            //       started before starting main
+            List<ServiceStartBuildItem> startList) {
+
+            recorder.start(shutdown, main.getInstance());
+        }
     }
 }
diff --git a/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainBuildItem.java b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelMainBuildItem.java
similarity index 88%
rename from extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainBuildItem.java
rename to extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelMainBuildItem.java
index 103c298..ccaae59 100644
--- a/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainBuildItem.java
+++ b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelMainBuildItem.java
@@ -14,12 +14,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.main.deployment;
+package org.apache.camel.quarkus.core.deployment;
 
 import io.quarkus.builder.item.SimpleBuildItem;
 import io.quarkus.runtime.RuntimeValue;
-import org.apache.camel.quarkus.main.CamelMain;
+import org.apache.camel.quarkus.core.CamelMain;
 
+/**
+ * Holds the {@link CamelMain} {@link RuntimeValue}.
+ */
 public final class CamelMainBuildItem extends SimpleBuildItem {
     private final RuntimeValue<CamelMain> main;
 
diff --git a/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainListenerBuildItem.java b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelMainListenerBuildItem.java
similarity index 92%
copy from extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainListenerBuildItem.java
copy to extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelMainListenerBuildItem.java
index f7769a3..188177e 100644
--- a/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainListenerBuildItem.java
+++ b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelMainListenerBuildItem.java
@@ -14,11 +14,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.main.deployment;
+package org.apache.camel.quarkus.core.deployment;
 
 import io.quarkus.builder.item.MultiBuildItem;
 import org.apache.camel.main.MainListener;
-import org.apache.camel.quarkus.main.CamelMain;
+import org.apache.camel.quarkus.core.CamelMain;
 
 /**
  * A {@link MultiBuildItem} holding {@link MainListener}s to add to {@link CamelMain}.
diff --git a/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainListenerBuildItem.java b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRoutesBuilderBuildItem.java
similarity index 62%
rename from extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainListenerBuildItem.java
rename to extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRoutesBuilderBuildItem.java
index f7769a3..485f20b 100644
--- a/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainListenerBuildItem.java
+++ b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRoutesBuilderBuildItem.java
@@ -14,23 +14,24 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.main.deployment;
+package org.apache.camel.quarkus.core.deployment;
 
 import io.quarkus.builder.item.MultiBuildItem;
-import org.apache.camel.main.MainListener;
-import org.apache.camel.quarkus.main.CamelMain;
+import io.quarkus.runtime.RuntimeValue;
+import org.apache.camel.RoutesBuilder;
+
 
 /**
- * A {@link MultiBuildItem} holding {@link MainListener}s to add to {@link CamelMain}.
+ * Holds the {@link RoutesBuilder} {@link RuntimeValue}.
  */
-public final class CamelMainListenerBuildItem extends MultiBuildItem {
-    private final MainListener listener;
+public final class CamelRoutesBuilderBuildItem extends MultiBuildItem {
+    private final RuntimeValue<RoutesBuilder> routesBuilder;
 
-    public CamelMainListenerBuildItem(MainListener listener) {
-        this.listener = listener;
+    public CamelRoutesBuilderBuildItem(RuntimeValue<RoutesBuilder> routesBuilder) {
+        this.routesBuilder = routesBuilder;
     }
 
-    public MainListener getListener() {
-        return listener;
+    public RuntimeValue<RoutesBuilder> getInstance() {
+        return routesBuilder;
     }
 }
diff --git a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/HotDeploymentProcessor.java b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/HotDeploymentProcessor.java
index 5dfd176..a3e7ccf 100644
--- a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/HotDeploymentProcessor.java
+++ b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/HotDeploymentProcessor.java
@@ -21,7 +21,7 @@ import java.util.stream.Collectors;
 
 import io.quarkus.deployment.annotations.BuildStep;
 import io.quarkus.deployment.builditem.HotDeploymentWatchedFileBuildItem;
-import org.apache.camel.quarkus.core.runtime.CamelConfig.BuildTime;
+import org.apache.camel.quarkus.core.CamelConfig.BuildTime;
 
 class HotDeploymentProcessor {
     @BuildStep
diff --git a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/SubstrateProcessor.java b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/SubstrateProcessor.java
index 8d3e809..6b0c0f6 100644
--- a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/SubstrateProcessor.java
+++ b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/SubstrateProcessor.java
@@ -35,7 +35,6 @@ import io.quarkus.deployment.builditem.substrate.ReflectiveClassBuildItem;
 import io.quarkus.deployment.builditem.substrate.ReflectiveMethodBuildItem;
 import io.quarkus.deployment.builditem.substrate.SubstrateConfigBuildItem;
 import io.quarkus.deployment.builditem.substrate.SubstrateResourceBuildItem;
-import io.quarkus.deployment.builditem.substrate.SubstrateResourceBundleBuildItem;
 import org.apache.camel.CamelContext;
 import org.apache.camel.Component;
 import org.apache.camel.Consumer;
@@ -43,6 +42,7 @@ import org.apache.camel.Converter;
 import org.apache.camel.Endpoint;
 import org.apache.camel.Producer;
 import org.apache.camel.TypeConverter;
+import org.apache.camel.quarkus.core.Flags;
 import org.apache.camel.spi.ExchangeFormatter;
 import org.apache.camel.spi.PropertiesComponent;
 import org.apache.camel.spi.ScheduledPollConsumerScheduler;
@@ -57,7 +57,11 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 class SubstrateProcessor {
-    private static final List<Class<?>> CAMEL_REFLECTIVE_CLASSES = Arrays.asList(
+    /*
+     * SubstrateVM configuration steps related to camel core.
+     */
+    public static class Core {
+        private static final List<Class<?>> CAMEL_REFLECTIVE_CLASSES = Arrays.asList(
             Endpoint.class,
             Consumer.class,
             Producer.class,
@@ -70,33 +74,29 @@ class SubstrateProcessor {
             StreamCachingStrategy.SpoolUsedHeapMemoryLimit.class,
             PropertiesComponent.class);
 
-    @Inject
-    BuildProducer<ReflectiveClassBuildItem> reflectiveClass;
-    @Inject
-    BuildProducer<ReflectiveMethodBuildItem> reflectiveMethod;
-    @Inject
-    BuildProducer<SubstrateResourceBuildItem> resource;
-    @Inject
-    BuildProducer<SubstrateResourceBundleBuildItem> resourceBundle;
-    @Inject
-    ApplicationArchivesBuildItem applicationArchivesBuildItem;
-    @Inject
-    CombinedIndexBuildItem combinedIndexBuildItem;
-
-    @BuildStep
-    SubstrateConfigBuildItem substrate() {
-        return SubstrateConfigBuildItem.builder()
-            // TODO: switch back to caffeine once https://github.com/apache/camel-quarkus/issues/80 gets fixed
-            .addNativeImageSystemProperty("CamelWarmUpLRUCacheFactory", "true")
-            .addNativeImageSystemProperty("CamelSimpleLRUCacheFactory", "true")
-            .build();
-    }
+        @Inject
+        BuildProducer<ReflectiveClassBuildItem> reflectiveClass;
+        @Inject
+        BuildProducer<ReflectiveMethodBuildItem> reflectiveMethod;
+        @Inject
+        BuildProducer<SubstrateResourceBuildItem> resource;
+        @Inject
+        ApplicationArchivesBuildItem applicationArchivesBuildItem;
+
+        @BuildStep
+        SubstrateConfigBuildItem cache() {
+            return SubstrateConfigBuildItem.builder()
+                // TODO: switch back to caffeine once https://github.com/apache/camel-quarkus/issues/80 gets fixed
+                .addNativeImageSystemProperty("CamelWarmUpLRUCacheFactory", "true")
+                .addNativeImageSystemProperty("CamelSimpleLRUCacheFactory", "true")
+                .build();
+        }
 
-    @BuildStep
-    void process() {
-        IndexView view = combinedIndexBuildItem.getIndex();
+        @BuildStep
+        void process(CombinedIndexBuildItem combinedIndex) {
+            IndexView view = combinedIndex.getIndex();
 
-        CAMEL_REFLECTIVE_CLASSES.stream()
+            CAMEL_REFLECTIVE_CLASSES.stream()
                 .map(Class::getName)
                 .map(DotName::createSimple)
                 .map(view::getAllKnownImplementors)
@@ -104,9 +104,9 @@ class SubstrateProcessor {
                 .filter(CamelSupport::isPublic)
                 .forEach(v -> addReflectiveClass(true, v.name().toString()));
 
-        Logger log = LoggerFactory.getLogger(SubstrateProcessor.class);
-        DotName converter = DotName.createSimple(Converter.class.getName());
-        List<ClassInfo> converterClasses = view.getAnnotations(converter)
+            Logger log = LoggerFactory.getLogger(SubstrateProcessor.class);
+            DotName converter = DotName.createSimple(Converter.class.getName());
+            List<ClassInfo> converterClasses = view.getAnnotations(converter)
                 .stream()
                 .filter(ai -> ai.target().kind() == Kind.CLASS)
                 .filter(ai -> {
@@ -128,63 +128,85 @@ class SubstrateProcessor {
                 .map(ai -> ai.target().asClass())
                 .collect(Collectors.toList());
 
-        log.debug("Converter classes: " + converterClasses);
-        converterClasses.forEach(ci -> addReflectiveClass(false, ci.name().toString()));
+            log.debug("Converter classes: " + converterClasses);
+            converterClasses.forEach(ci -> addReflectiveClass(false, ci.name().toString()));
 
-        view.getAnnotations(converter)
+            view.getAnnotations(converter)
                 .stream()
                 .filter(ai -> ai.target().kind() == Kind.METHOD)
                 .filter(ai -> converterClasses.contains(ai.target().asMethod().declaringClass()))
                 .map(ai -> ai.target().asMethod())
                 .forEach(this::addReflectiveMethod);
 
-        CamelSupport.resources(applicationArchivesBuildItem, "META-INF/maven/org.apache.camel/camel-core")
+            CamelSupport.resources(applicationArchivesBuildItem, "META-INF/maven/org.apache.camel/camel-core")
                 .forEach(this::addResource);
-
-        addCamelServices();
-    }
-
-    // Camel services files
-    protected void addCamelServices() {
-        CamelSupport.resources(applicationArchivesBuildItem, CamelSupport.CAMEL_SERVICE_BASE_PATH)
+            CamelSupport.resources(applicationArchivesBuildItem, CamelSupport.CAMEL_SERVICE_BASE_PATH)
                 .forEach(this::addCamelService);
-    }
+        }
 
-    protected void addCamelService(Path p) {
-        try (InputStream is = Files.newInputStream(p)) {
-            Properties props = new Properties();
-            props.load(is);
-            for (Map.Entry<Object, Object> entry : props.entrySet()) {
-                String k = entry.getKey().toString();
-                if (k.equals("class")) {
-                    addReflectiveClass(true, entry.getValue().toString());
-                } else if (k.endsWith(".class")) {
-                    addReflectiveClass(true, entry.getValue().toString());
-                    addResource(p);
+        protected void addCamelService(Path p) {
+            try (InputStream is = Files.newInputStream(p)) {
+                Properties props = new Properties();
+                props.load(is);
+                for (Map.Entry<Object, Object> entry : props.entrySet()) {
+                    String k = entry.getKey().toString();
+                    if (k.equals("class")) {
+                        addReflectiveClass(true, entry.getValue().toString());
+                    } else if (k.endsWith(".class")) {
+                        addReflectiveClass(true, entry.getValue().toString());
+                        addResource(p);
+                    }
                 }
+            } catch (Exception e) {
+                throw new RuntimeException(e);
             }
-        } catch (Exception e) {
-            throw new RuntimeException(e);
         }
-    }
 
-    protected void addResource(Path p) {
-        addResource(p.toString().substring(1));
-    }
+        protected void addResource(Path p) {
+            addResource(p.toString().substring(1));
+        }
 
-    protected void addResource(String r) {
-        resource.produce(new SubstrateResourceBuildItem(r));
-    }
+        protected void addResource(String r) {
+            resource.produce(new SubstrateResourceBuildItem(r));
+        }
 
-    protected void addReflectiveClass(boolean methods, String... className) {
-        reflectiveClass.produce(new ReflectiveClassBuildItem(methods, false, className));
-    }
+        protected void addReflectiveClass(boolean methods, String... className) {
+            reflectiveClass.produce(new ReflectiveClassBuildItem(methods, false, className));
+        }
 
-    protected void addReflectiveMethod(MethodInfo mi) {
-        reflectiveMethod.produce(new ReflectiveMethodBuildItem(mi));
+        protected void addReflectiveMethod(MethodInfo mi) {
+            reflectiveMethod.produce(new ReflectiveMethodBuildItem(mi));
+        }
     }
 
-    protected void addResourceBundle(String bundle) {
-        resourceBundle.produce(new SubstrateResourceBundleBuildItem(bundle));
+    /*
+     * SubstrateVM configuration steps related to camel main that are activated by default but can be
+     * disabled by setting quarkus.camel.disable-main = true
+     */
+    public static class Main {
+        @BuildStep(onlyIfNot = Flags.MainDisabled.class)
+        void process(
+            CombinedIndexBuildItem combinedIndex,
+            BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {
+
+            IndexView view = combinedIndex.getIndex();
+
+            //
+            // Register routes as reflection aware as camel-main main use reflection
+            // to bind beans to the registry
+            //
+            CamelSupport.getRouteBuilderClasses(view).forEach(name -> {
+                reflectiveClass.produce(new ReflectiveClassBuildItem(true, false, name));
+            });
+
+            reflectiveClass.produce(new ReflectiveClassBuildItem(
+                true,
+                false,
+                org.apache.camel.main.DefaultConfigurationProperties.class,
+                org.apache.camel.main.MainConfigurationProperties.class,
+                org.apache.camel.main.HystrixConfigurationProperties.class,
+                org.apache.camel.main.RestConfigurationProperties.class)
+            );
+        }
     }
 }
diff --git a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/XmlProcessor.java b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/XmlProcessor.java
index df6dd15..58b0bcf 100644
--- a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/XmlProcessor.java
+++ b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/XmlProcessor.java
@@ -21,7 +21,7 @@ import io.quarkus.deployment.annotations.BuildStep;
 import io.quarkus.deployment.builditem.substrate.ReflectiveClassBuildItem;
 import io.quarkus.jaxb.deployment.JaxbEnabledBuildItem;
 import io.quarkus.jaxb.deployment.JaxbFileRootBuildItem;
-import org.apache.camel.quarkus.core.runtime.support.Flags;
+import org.apache.camel.quarkus.core.Flags;
 
 class XmlProcessor {
     @BuildStep
diff --git a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/devmode/CamelHotReplacementSetup.java b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/devmode/CamelHotReplacementSetup.java
index 4121e1f..91ee733 100644
--- a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/devmode/CamelHotReplacementSetup.java
+++ b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/devmode/CamelHotReplacementSetup.java
@@ -24,7 +24,6 @@ import io.quarkus.deployment.devmode.HotReplacementContext;
 import io.quarkus.deployment.devmode.HotReplacementSetup;
 
 public class CamelHotReplacementSetup implements HotReplacementSetup {
-
     private static final long TWO_SECS = TimeUnit.SECONDS.toMillis(2);
 
     @Override
diff --git a/extensions/core/runtime/pom.xml b/extensions/core/runtime/pom.xml
index caa7e0d..5683b69 100644
--- a/extensions/core/runtime/pom.xml
+++ b/extensions/core/runtime/pom.xml
@@ -57,6 +57,10 @@
         <!-- camel -->
         <dependency>
             <groupId>org.apache.camel</groupId>
+            <artifactId>camel-main</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
             <artifactId>camel-core-engine</artifactId>
         </dependency>
         <dependency>
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/BeanManagerHelper.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/BeanManagerHelper.java
similarity index 98%
rename from extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/BeanManagerHelper.java
rename to extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/BeanManagerHelper.java
index 2051c6c..89d87e8 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/BeanManagerHelper.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/BeanManagerHelper.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core.runtime.support;
+package org.apache.camel.quarkus.core;
 
 import java.lang.annotation.Annotation;
 import java.util.HashMap;
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelConfig.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelConfig.java
similarity index 87%
rename from extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelConfig.java
rename to extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelConfig.java
index a5bb9b4..ecf9989 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelConfig.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelConfig.java
@@ -14,26 +14,18 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core.runtime;
+package org.apache.camel.quarkus.core;
 
 import java.util.List;
 
 import io.quarkus.runtime.annotations.ConfigItem;
 import io.quarkus.runtime.annotations.ConfigPhase;
 import io.quarkus.runtime.annotations.ConfigRoot;
-import org.apache.camel.quarkus.core.runtime.support.Flags;
 
 public class CamelConfig {
 
     @ConfigRoot(name = "camel", phase = ConfigPhase.BUILD_AND_RUN_TIME_FIXED)
     public static class BuildTime {
-
-        /**
-         * Uri to an xml containing camel routes to be loaded and initialized at build time.
-         */
-        @ConfigItem
-        public List<String> routesUris;
-
         /**
          * Camel jaxb support is enabled by default, but in order to trim
          * down the size of applications, it is possible to disable jaxb support
@@ -55,6 +47,21 @@ public class CamelConfig {
          */
         @ConfigItem(defaultValue = "false")
         public boolean disableXml;
+
+        /**
+         * Disable camel-main.
+         * When main is disabled, routes won't be automatically be loaded and
+         * started and the entire lifecycle of the Camel Context is under user
+         * control.
+         */
+        @ConfigItem(defaultValue = "false")
+        public boolean disableMain;
+
+        /**
+         * Uri to an xml containing camel routes to be loaded and initialized at build time.
+         */
+        @ConfigItem
+        public List<String> routesUris;
     }
 
     @ConfigRoot(name = "camel", phase = ConfigPhase.RUN_TIME)
diff --git a/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMain.java
similarity index 93%
rename from extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java
rename to extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMain.java
index e533f35..2c71954 100644
--- a/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMain.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.main;
+package org.apache.camel.quarkus.core;
 
 import java.util.Collection;
 import java.util.Collections;
@@ -53,7 +53,7 @@ public class CamelMain extends MainSupport implements CamelContextAware {
                 camelTemplate = null;
             }
         } catch (Exception e) {
-            LOG.debug("Error stopping camelTemplate due " + e.getMessage() + ". This exception is ignored.", e);
+            MainSupport.LOG.debug("Error stopping camelTemplate due " + e.getMessage() + ". This exception is ignored.", e);
         }
 
         beforeStop();
diff --git a/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainEventDispatcher.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainEventDispatcher.java
similarity index 98%
rename from extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainEventDispatcher.java
rename to extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainEventDispatcher.java
index 71de2e9..f6504c5 100644
--- a/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainEventDispatcher.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainEventDispatcher.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.main;
+package org.apache.camel.quarkus.core;
 
 import io.quarkus.arc.Arc;
 import org.apache.camel.CamelContext;
diff --git a/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainEvents.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainEvents.java
similarity index 97%
rename from extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainEvents.java
rename to extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainEvents.java
index 19693b8..bfddcdc 100644
--- a/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainEvents.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainEvents.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.main;
+package org.apache.camel.quarkus.core;
 
 public final class CamelMainEvents {
     private CamelMainEvents() {
diff --git a/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainProducers.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainProducers.java
similarity index 96%
rename from extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainProducers.java
rename to extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainProducers.java
index f830cc3..04ab8a8 100644
--- a/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainProducers.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainProducers.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.main;
+package org.apache.camel.quarkus.core;
 
 import javax.enterprise.inject.Produces;
 import javax.inject.Singleton;
diff --git a/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRecorder.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainRecorder.java
similarity index 61%
rename from extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRecorder.java
rename to extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainRecorder.java
index 914afe9..f9d7236 100644
--- a/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRecorder.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelMainRecorder.java
@@ -14,14 +14,21 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.main;
+package org.apache.camel.quarkus.core;
+
+import java.io.InputStream;
 
 import io.quarkus.arc.runtime.BeanContainer;
 import io.quarkus.runtime.RuntimeValue;
 import io.quarkus.runtime.ShutdownContext;
 import io.quarkus.runtime.annotations.Recorder;
 import org.apache.camel.CamelContext;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.main.MainListener;
+import org.apache.camel.model.Model;
+import org.apache.camel.support.ResourceHelper;
+import org.apache.camel.util.ObjectHelper;
 
 @Recorder
 public class CamelMainRecorder {
@@ -51,6 +58,40 @@ public class CamelMainRecorder {
         }
     }
 
+
+    public void addRouteBuilder(
+            RuntimeValue<CamelMain> main,
+            RuntimeValue<RoutesBuilder> routesBuilder) {
+
+        RoutesBuilder builder = routesBuilder.getValue();
+
+        // TODO: camel main may need to support RoutesBuilder instead of RouteBuilder only
+        if (!(builder instanceof RouteBuilder)) {
+            throw new IllegalArgumentException("Cannot handle routes builder of type: '" + builder.getClass().getName() + "'");
+        }
+
+        try {
+            main.getValue().addRouteBuilder((RouteBuilder)builder);
+        } catch (Exception e) {
+            throw new RuntimeException("Could not add route builder '" + builder.getClass().getName() + "'", e);
+        }
+    }
+
+    public void addRoutesFromLocation(
+            RuntimeValue<CamelMain> main,
+            String location) {
+
+        if (ObjectHelper.isNotEmpty(location)) {
+            // TODO: if pointing to a directory, we should load all xmls in it
+            //   (maybe with glob support in it to be complete)
+            try (InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(main.getValue().getCamelContext(), location)) {
+                main.getValue().getCamelContext().getExtension(Model.class).addRouteDefinitions(is);
+            } catch (Exception e) {
+                throw new RuntimeException(e);
+            }
+        }
+    }
+
     public void addListener(RuntimeValue<CamelMain> main, MainListener listener) {
         main.getValue().addMainListener(listener);
     }
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelProducers.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelProducers.java
similarity index 97%
rename from extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelProducers.java
rename to extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelProducers.java
index c97e710..3801213 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelProducers.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelProducers.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core.runtime;
+package org.apache.camel.quarkus.core;
 
 import javax.enterprise.inject.Produces;
 import javax.inject.Singleton;
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRecorder.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelRecorder.java
similarity index 92%
rename from extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRecorder.java
rename to extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelRecorder.java
index b162104..c18c94a 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRecorder.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/CamelRecorder.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core.runtime;
+package org.apache.camel.quarkus.core;
 
 import io.quarkus.arc.runtime.BeanContainer;
 import io.quarkus.runtime.RuntimeValue;
@@ -22,9 +22,6 @@ import io.quarkus.runtime.annotations.Recorder;
 import org.apache.camel.CamelContext;
 import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.quarkus.core.runtime.support.FastCamelContext;
-import org.apache.camel.quarkus.core.runtime.support.FastModel;
-import org.apache.camel.quarkus.core.runtime.support.RuntimeRegistry;
 import org.apache.camel.spi.Registry;
 import org.graalvm.nativeimage.ImageInfo;
 
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelContext.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/FastCamelContext.java
similarity index 99%
rename from extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelContext.java
rename to extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/FastCamelContext.java
index 1096806..a73b143 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelContext.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/FastCamelContext.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core.runtime.support;
+package org.apache.camel.quarkus.core;
 
 import java.util.Collection;
 import java.util.Map;
@@ -66,7 +66,7 @@ import org.apache.camel.impl.transformer.TransformerKey;
 import org.apache.camel.impl.validator.ValidatorKey;
 import org.apache.camel.model.Model;
 import org.apache.camel.processor.MulticastProcessor;
-import org.apache.camel.quarkus.core.runtime.support.FastModel.FastRouteContext;
+import org.apache.camel.quarkus.core.FastModel.FastRouteContext;
 import org.apache.camel.spi.AsyncProcessorAwaitManager;
 import org.apache.camel.spi.BeanIntrospection;
 import org.apache.camel.spi.BeanProcessorFactory;
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastModel.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/FastModel.java
similarity index 99%
rename from extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastModel.java
rename to extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/FastModel.java
index 35788a3..eb4f6d6 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastModel.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/FastModel.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core.runtime.support;
+package org.apache.camel.quarkus.core;
 
 import java.util.ArrayList;
 import java.util.List;
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastUuidGenerator.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/FastUuidGenerator.java
similarity index 96%
rename from extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastUuidGenerator.java
rename to extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/FastUuidGenerator.java
index c6447fd..960dfd2 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastUuidGenerator.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/FastUuidGenerator.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core.runtime.support;
+package org.apache.camel.quarkus.core;
 
 import java.util.concurrent.ThreadLocalRandom;
 import java.util.concurrent.atomic.AtomicLong;
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/Flags.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/Flags.java
similarity index 82%
rename from extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/Flags.java
rename to extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/Flags.java
index 69247e2..0b6d029 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/Flags.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/Flags.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core.runtime.support;
+package org.apache.camel.quarkus.core;
 
 import java.util.function.BooleanSupplier;
 
@@ -38,4 +38,10 @@ public final class Flags {
         }
     }
 
+    public static final class MainDisabled implements BooleanSupplier {
+        @Override
+        public boolean getAsBoolean() {
+            return ConfigProvider.getConfig().getOptionalValue("quarkus.camel.disable-main", Boolean.class).orElse(Boolean.FALSE);
+        }
+    }
 }
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/NoShutdownStrategy.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/NoShutdownStrategy.java
similarity index 98%
rename from extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/NoShutdownStrategy.java
rename to extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/NoShutdownStrategy.java
index dd70b85..4110fba 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/NoShutdownStrategy.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/NoShutdownStrategy.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core.runtime.support;
+package org.apache.camel.quarkus.core;
 
 import java.util.List;
 import java.util.concurrent.TimeUnit;
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/RuntimeBeanRepository.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/RuntimeBeanRepository.java
similarity index 96%
rename from extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/RuntimeBeanRepository.java
rename to extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/RuntimeBeanRepository.java
index c89aed8..61d5e80 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/RuntimeBeanRepository.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/RuntimeBeanRepository.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core.runtime.support;
+package org.apache.camel.quarkus.core;
 
 import java.util.Map;
 import java.util.Set;
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/RuntimeRegistry.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/RuntimeRegistry.java
similarity index 95%
rename from extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/RuntimeRegistry.java
rename to extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/RuntimeRegistry.java
index a640cbf..9324e8e 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/RuntimeRegistry.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/RuntimeRegistry.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core.runtime.support;
+package org.apache.camel.quarkus.core;
 
 import io.quarkus.runtime.RuntimeValue;
 import org.apache.camel.support.DefaultRegistry;
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/graal/SubstituteHostUtils.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/graal/SubstituteHostUtils.java
similarity index 95%
rename from extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/graal/SubstituteHostUtils.java
rename to extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/graal/SubstituteHostUtils.java
index 114d3a6..191e126 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/graal/SubstituteHostUtils.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/graal/SubstituteHostUtils.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core.runtime.graal;
+package org.apache.camel.quarkus.core.graal;
 
 import java.net.InetAddress;
 import java.net.UnknownHostException;
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/graal/SubstituteIntrospectionSupport.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/graal/SubstituteIntrospectionSupport.java
similarity index 96%
rename from extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/graal/SubstituteIntrospectionSupport.java
rename to extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/graal/SubstituteIntrospectionSupport.java
index 8a666ee..d0d0254 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/graal/SubstituteIntrospectionSupport.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/graal/SubstituteIntrospectionSupport.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core.runtime.graal;
+package org.apache.camel.quarkus.core.graal;
 
 import java.util.Map;
 
diff --git a/extensions/main/deployment/pom.xml b/extensions/main/deployment/pom.xml
deleted file mode 100644
index 5e7657d..0000000
--- a/extensions/main/deployment/pom.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You under the Apache License, Version 2.0
-    (the "License"); you may not use this file except in compliance with
-    the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.camel.quarkus</groupId>
-        <artifactId>camel-quarkus-main-parent</artifactId>
-        <version>0.2.1-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-
-    <artifactId>camel-quarkus-main-deployment</artifactId>
-    <name>Camel Quarkus :: Main :: Deployment</name>
-
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>org.apache.camel.quarkus</groupId>
-                <artifactId>camel-quarkus-bom-deployment</artifactId>
-                <version>${project.version}</version>
-                <type>pom</type>
-                <scope>import</scope>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core-deployment</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-main</artifactId>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <annotationProcessorPaths>
-                        <path>
-                            <groupId>io.quarkus</groupId>
-                            <artifactId>quarkus-extension-processor</artifactId>
-                            <version>${quarkus.version}</version>
-                        </path>
-                    </annotationProcessorPaths>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-
-</project>
diff --git a/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/BuildProcessor.java b/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/BuildProcessor.java
deleted file mode 100644
index 3ea1adf..0000000
--- a/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/BuildProcessor.java
+++ /dev/null
@@ -1,77 +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.main.deployment;
-
-import java.util.List;
-
-import io.quarkus.arc.deployment.AdditionalBeanBuildItem;
-import io.quarkus.arc.deployment.BeanContainerBuildItem;
-import io.quarkus.deployment.annotations.BuildProducer;
-import io.quarkus.deployment.annotations.BuildStep;
-import io.quarkus.deployment.annotations.ExecutionTime;
-import io.quarkus.deployment.annotations.Record;
-import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
-import io.quarkus.deployment.builditem.ServiceStartBuildItem;
-import io.quarkus.deployment.builditem.ShutdownContextBuildItem;
-import io.quarkus.runtime.RuntimeValue;
-import org.apache.camel.quarkus.core.deployment.CamelContextBuildItem;
-import org.apache.camel.quarkus.core.deployment.CamelSupport;
-import org.apache.camel.quarkus.main.CamelMain;
-import org.apache.camel.quarkus.main.CamelMainProducers;
-import org.apache.camel.quarkus.main.CamelMainRecorder;
-
-public class BuildProcessor {
-    @BuildStep
-    void beans(BuildProducer<AdditionalBeanBuildItem> beanProducer) {
-        beanProducer.produce(AdditionalBeanBuildItem.unremovableOf(CamelMainProducers.class));
-    }
-
-    @Record(ExecutionTime.STATIC_INIT)
-    @BuildStep
-    CamelMainBuildItem create(
-            CombinedIndexBuildItem combinedIndexBuildItem,
-            CamelMainRecorder recorder,
-            CamelContextBuildItem context,
-            List<CamelMainListenerBuildItem> listeners,
-            BeanContainerBuildItem beanContainerBuildItem) {
-
-        RuntimeValue<CamelMain> main = recorder.createCamelMain(context.getCamelContext(), beanContainerBuildItem.getValue());
-        for (CamelMainListenerBuildItem listener: listeners) {
-            recorder.addListener(main, listener.getListener());
-        }
-
-        CamelSupport.getRouteBuilderClasses(combinedIndexBuildItem.getIndex()).forEach(name -> {
-            recorder.addRouteBuilder(main, name);
-        });
-
-        return new CamelMainBuildItem(main);
-    }
-
-    @Record(ExecutionTime.RUNTIME_INIT)
-    @BuildStep
-    void start(
-            CamelMainRecorder recorder,
-            CamelMainBuildItem main,
-            ShutdownContextBuildItem shutdown,
-            CombinedIndexBuildItem combinedIndexBuildItem,
-            // TODO: keep this list as placeholder to ensure the ArC container is fully
-            //       started before starting main
-            List<ServiceStartBuildItem> startList) {
-
-        recorder.start(shutdown, main.getInstance());
-    }
-}
diff --git a/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/Feature.java b/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/Feature.java
deleted file mode 100644
index b731581..0000000
--- a/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/Feature.java
+++ /dev/null
@@ -1,29 +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.main.deployment;
-
-import io.quarkus.deployment.annotations.BuildStep;
-import io.quarkus.deployment.builditem.FeatureBuildItem;
-
-class Feature {
-    private static final String FEATURE = "camel-main";
-
-    @BuildStep
-    FeatureBuildItem feature() {
-        return new FeatureBuildItem(FEATURE);
-    }
-}
diff --git a/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/SubstrateProcessor.java b/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/SubstrateProcessor.java
deleted file mode 100644
index 8f69637..0000000
--- a/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/SubstrateProcessor.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.main.deployment;
-
-import io.quarkus.deployment.annotations.BuildProducer;
-import io.quarkus.deployment.annotations.BuildStep;
-import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
-import io.quarkus.deployment.builditem.substrate.ReflectiveClassBuildItem;
-import org.apache.camel.quarkus.core.deployment.CamelSupport;
-import org.jboss.jandex.IndexView;
-
-public class SubstrateProcessor {
-    @BuildStep
-    void process(
-            CombinedIndexBuildItem combinedIndexBuildItem,
-            BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {
-
-        IndexView view = combinedIndexBuildItem.getIndex();
-
-        //
-        // Register routes as reflection aware as camel-main main use reflection
-        // to bind beans to the registry
-        //
-        CamelSupport.getRouteBuilderClasses(view).forEach(name -> {
-            reflectiveClass.produce(new ReflectiveClassBuildItem(true, false, name));
-        });
-
-        reflectiveClass.produce(new ReflectiveClassBuildItem(
-            true,
-            false,
-            org.apache.camel.main.DefaultConfigurationProperties.class,
-            org.apache.camel.main.MainConfigurationProperties.class,
-            org.apache.camel.main.HystrixConfigurationProperties.class,
-            org.apache.camel.main.RestConfigurationProperties.class)
-        );
-    }
-}
diff --git a/extensions/main/pom.xml b/extensions/main/pom.xml
deleted file mode 100644
index 1d83e2f..0000000
--- a/extensions/main/pom.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You under the Apache License, Version 2.0
-    (the "License"); you may not use this file except in compliance with
-    the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
-    <parent>
-        <groupId>org.apache.camel.quarkus</groupId>
-        <artifactId>camel-quarkus-build-parent</artifactId>
-        <version>0.2.1-SNAPSHOT</version>
-        <relativePath>../../poms/build-parent/pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>camel-quarkus-main-parent</artifactId>
-    <name>Camel Quarkus :: Main</name>
-    <packaging>pom</packaging>
-    <modules>
-        <module>deployment</module>
-        <module>runtime</module>
-    </modules>
-
-</project>
diff --git a/extensions/main/runtime/pom.xml b/extensions/main/runtime/pom.xml
deleted file mode 100644
index c9dd7ad..0000000
--- a/extensions/main/runtime/pom.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You under the Apache License, Version 2.0
-    (the "License"); you may not use this file except in compliance with
-    the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.camel.quarkus</groupId>
-        <artifactId>camel-quarkus-main-parent</artifactId>
-        <version>0.2.1-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-
-    <artifactId>camel-quarkus-main</artifactId>
-    <name>Camel Quarkus :: Main :: Runtime</name>
-
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>org.apache.camel.quarkus</groupId>
-                <artifactId>camel-quarkus-bom</artifactId>
-                <version>${project.version}</version>
-                <type>pom</type>
-                <scope>import</scope>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core</artifactId>
-        </dependency>
-
-        <!-- Camel -->
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-main</artifactId>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>io.quarkus</groupId>
-                <artifactId>quarkus-bootstrap-maven-plugin</artifactId>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <annotationProcessorPaths>
-                        <path>
-                            <groupId>io.quarkus</groupId>
-                            <artifactId>quarkus-extension-processor</artifactId>
-                            <version>${quarkus.version}</version>
-                        </path>
-                    </annotationProcessorPaths>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-</project>
diff --git a/extensions/pom.xml b/extensions/pom.xml
index d2c369b..1096421 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -42,7 +42,6 @@
         <module>http-common</module>
 
         <!-- components -->
-        <module>main</module>
         <module>netty-http</module>
         <module>infinispan</module>
         <module>aws-s3</module>
diff --git a/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/CustomDefaultServletClassTest.java b/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/CustomDefaultServletClassTest.java
index af5a542..627ac71 100644
--- a/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/CustomDefaultServletClassTest.java
+++ b/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/CustomDefaultServletClassTest.java
@@ -24,7 +24,6 @@ import java.util.Properties;
 import io.quarkus.test.QuarkusUnitTest;
 import io.restassured.RestAssured;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.impl.DefaultCamelContext;
 import org.hamcrest.core.IsEqual;
 import org.jboss.shrinkwrap.api.ShrinkWrap;
 import org.jboss.shrinkwrap.api.asset.Asset;
@@ -37,21 +36,14 @@ public class CustomDefaultServletClassTest {
     @RegisterExtension
     static final QuarkusUnitTest CONFIG = new QuarkusUnitTest()
         .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)
+            .addClass(Routes.class)
             .addAsResource(applicationProperties(), "application.properties"));
 
     @Test
     public void customDefaultServletClass() throws Exception {
-        DefaultCamelContext context = new DefaultCamelContext();
-        context.addRoutes(new Routes());
-        context.start();
-
-        try {
-            RestAssured.when().get("/custom").then()
-                .body(IsEqual.equalTo("GET: /custom"))
-                .and().header("x-servlet-class-name", CustomServlet.class.getName());
-        } finally {
-            context.stop();
-        }
+        RestAssured.when().get("/custom").then()
+            .body(IsEqual.equalTo("GET: /custom"))
+            .and().header("x-servlet-class-name", CustomServlet.class.getName());
     }
 
     public static final class Routes extends RouteBuilder {
diff --git a/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/MinimalConfigTest.java b/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/MinimalConfigTest.java
index 544823e..e93a01b 100644
--- a/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/MinimalConfigTest.java
+++ b/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/MinimalConfigTest.java
@@ -24,7 +24,6 @@ import java.util.Properties;
 import io.quarkus.test.QuarkusUnitTest;
 import io.restassured.RestAssured;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.impl.DefaultCamelContext;
 import org.hamcrest.core.IsEqual;
 import org.jboss.shrinkwrap.api.ShrinkWrap;
 import org.jboss.shrinkwrap.api.asset.Asset;
@@ -37,19 +36,13 @@ public class MinimalConfigTest {
     @RegisterExtension
     static final QuarkusUnitTest CONFIG = new QuarkusUnitTest()
         .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)
+            .addClass(CustomDefaultServletClassTest.Routes.class)
             .addAsResource(applicationProperties(), "application.properties"));
 
     @Test
     public void minimal() throws Exception {
-        DefaultCamelContext context = new DefaultCamelContext();
-        context.addRoutes(new Routes());
-        context.start();
-
-        try {
-            RestAssured.when().get("/hello").then().body(IsEqual.equalTo("GET: /hello"));
-        } finally {
-            context.stop();
-        }
+        RestAssured.when().get("/hello")
+            .then().body(IsEqual.equalTo("GET: /hello"));
     }
 
     public static final class Routes extends RouteBuilder {
diff --git a/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/NoDefaultServletTest.java b/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/NoDefaultServletTest.java
index b22bf9d..331f7fa 100644
--- a/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/NoDefaultServletTest.java
+++ b/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/NoDefaultServletTest.java
@@ -24,7 +24,6 @@ import java.util.Properties;
 import io.quarkus.test.QuarkusUnitTest;
 import io.restassured.RestAssured;
 import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.impl.DefaultCamelContext;
 import org.hamcrest.core.IsEqual;
 import org.jboss.shrinkwrap.api.ShrinkWrap;
 import org.jboss.shrinkwrap.api.asset.Asset;
@@ -37,21 +36,14 @@ public class NoDefaultServletTest {
     @RegisterExtension
     static final QuarkusUnitTest CONFIG = new QuarkusUnitTest()
         .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)
+            .addClass(CustomDefaultServletClassTest.Routes.class)
             .addAsResource(applicationProperties(), "application.properties"));
 
     @Test
     public void noDefaultServlet() throws Exception {
-        DefaultCamelContext context = new DefaultCamelContext();
-        context.addRoutes(new Routes());
-        context.start();
-
-        try {
-            RestAssured.when().get("/my-path/custom").then()
-                .body(IsEqual.equalTo("GET: /custom"))
-                .and().header("x-servlet-class-name", CustomServlet.class.getName());
-        } finally {
-            context.stop();
-        }
+        RestAssured.when().get("/my-path/custom").then()
+            .body(IsEqual.equalTo("GET: /custom"))
+            .and().header("x-servlet-class-name", CustomServlet.class.getName());
     }
 
     public static final class Routes extends RouteBuilder {
diff --git a/integration-tests/aws/pom.xml b/integration-tests/aws/pom.xml
index 405dccb..a077bf8 100644
--- a/integration-tests/aws/pom.xml
+++ b/integration-tests/aws/pom.xml
@@ -32,7 +32,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-main</artifactId>
+            <artifactId>camel-quarkus-core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
diff --git a/integration-tests/bean/pom.xml b/integration-tests/bean/pom.xml
index 7b5ec49..33fbaff 100644
--- a/integration-tests/bean/pom.xml
+++ b/integration-tests/bean/pom.xml
@@ -32,7 +32,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-main</artifactId>
+            <artifactId>camel-quarkus-core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
diff --git a/integration-tests/core-impl/pom.xml b/integration-tests/core-impl/pom.xml
index 8e71031..e164bb0 100644
--- a/integration-tests/core-impl/pom.xml
+++ b/integration-tests/core-impl/pom.xml
@@ -26,7 +26,7 @@
     <modelVersion>4.0.0</modelVersion>
 
     <artifactId>camel-quarkus-integration-test-core-impl</artifactId>
-    <name>Camel Quarkus :: Integration Tests :: Core :: Impl</name>
+    <name>Camel Quarkus :: Integration Tests :: Core Impl</name>
     <description>The camel integration tests</description>
 
     <dependencies>
diff --git a/integration-tests/core-impl/src/main/resources/application.properties b/integration-tests/core-impl/src/main/resources/application.properties
index 775072e..f87c33f 100644
--- a/integration-tests/core-impl/src/main/resources/application.properties
+++ b/integration-tests/core-impl/src/main/resources/application.properties
@@ -24,6 +24,7 @@ quarkus.log.file.enable = false
 #
 quarkus.camel.disable-xml=true
 quarkus.camel.disable-jaxb=true
+quarkus.camel.disable-main=true
 quarkus.camel.dump-routes=true
 #
 # Camel
diff --git a/integration-tests/main/deployment/pom.xml b/integration-tests/core-main/deployment/pom.xml
similarity index 79%
rename from integration-tests/main/deployment/pom.xml
rename to integration-tests/core-main/deployment/pom.xml
index e07be04..89f6e17 100644
--- a/integration-tests/main/deployment/pom.xml
+++ b/integration-tests/core-main/deployment/pom.xml
@@ -2,13 +2,13 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>org.apache.camel.quarkus</groupId>
-        <artifactId>camel-quarkus-integration-test-main-parent</artifactId>
+        <artifactId>camel-quarkus-integration-test-core-main-parent</artifactId>
         <version>0.2.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>camel-quarkus-integration-test-main-ext-deployment</artifactId>
-    <name>Camel Quarkus :: Integration Tests :: Main :: Extension :: Deployment</name>
+    <artifactId>camel-quarkus-integration-test-core-main-ext-deployment</artifactId>
+    <name>Camel Quarkus :: Integration Tests :: Core Main :: Extension :: Deployment</name>
     <description>A test extension</description>
 
     <dependencyManagement>
@@ -30,11 +30,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-main-deployment</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-integration-test-main-ext</artifactId>
+            <artifactId>camel-quarkus-integration-test-core-main-ext</artifactId>
         </dependency>
     </dependencies>
 
diff --git a/integration-tests/main/deployment/src/main/java/org/apache/camel/quarkus/main/support/deployment/Feature.java b/integration-tests/core-main/deployment/src/main/java/org/apache/camel/quarkus/core/runtime/support/deployment/Feature.java
similarity index 94%
rename from integration-tests/main/deployment/src/main/java/org/apache/camel/quarkus/main/support/deployment/Feature.java
rename to integration-tests/core-main/deployment/src/main/java/org/apache/camel/quarkus/core/runtime/support/deployment/Feature.java
index cc68cbd..fcda057 100644
--- a/integration-tests/main/deployment/src/main/java/org/apache/camel/quarkus/main/support/deployment/Feature.java
+++ b/integration-tests/core-main/deployment/src/main/java/org/apache/camel/quarkus/core/runtime/support/deployment/Feature.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.main.support.deployment;
+package org.apache.camel.quarkus.core.runtime.support.deployment;
 
 import io.quarkus.deployment.annotations.BuildStep;
 import io.quarkus.deployment.builditem.FeatureBuildItem;
diff --git a/integration-tests/main/deployment/src/main/java/org/apache/camel/quarkus/main/support/deployment/SupportBuildStep.java b/integration-tests/core-main/deployment/src/main/java/org/apache/camel/quarkus/core/runtime/support/deployment/SupportBuildStep.java
similarity index 84%
rename from integration-tests/main/deployment/src/main/java/org/apache/camel/quarkus/main/support/deployment/SupportBuildStep.java
rename to integration-tests/core-main/deployment/src/main/java/org/apache/camel/quarkus/core/runtime/support/deployment/SupportBuildStep.java
index eecce74..3cc84f8 100644
--- a/integration-tests/main/deployment/src/main/java/org/apache/camel/quarkus/main/support/deployment/SupportBuildStep.java
+++ b/integration-tests/core-main/deployment/src/main/java/org/apache/camel/quarkus/core/runtime/support/deployment/SupportBuildStep.java
@@ -14,12 +14,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.main.support.deployment;
+package org.apache.camel.quarkus.core.runtime.support.deployment;
 
 import io.quarkus.deployment.annotations.BuildProducer;
 import io.quarkus.deployment.annotations.BuildStep;
-import org.apache.camel.quarkus.main.deployment.CamelMainListenerBuildItem;
-import org.apache.camel.quarkus.main.support.SupportListener;
+import org.apache.camel.quarkus.core.deployment.CamelMainListenerBuildItem;
+import org.apache.camel.quarkus.core.runtime.support.SupportListener;
 
 public class SupportBuildStep {
     @BuildStep
diff --git a/integration-tests/main/pom.xml b/integration-tests/core-main/pom.xml
similarity index 87%
rename from integration-tests/main/pom.xml
rename to integration-tests/core-main/pom.xml
index 81ae321..d7307aa 100644
--- a/integration-tests/main/pom.xml
+++ b/integration-tests/core-main/pom.xml
@@ -23,14 +23,14 @@
     <modelVersion>4.0.0</modelVersion>
     <packaging>pom</packaging>
 
-    <artifactId>camel-quarkus-integration-test-main-parent</artifactId>
-    <name>Camel Quarkus :: Integration Tests :: Main :: Parent</name>
+    <artifactId>camel-quarkus-integration-test-core-main-parent</artifactId>
+    <name>Camel Quarkus :: Integration Tests :: Core Main :: Parent</name>
 
     <dependencyManagement>
         <dependencies>
             <dependency>
                 <groupId>org.apache.camel.quarkus</groupId>
-                <artifactId>camel-quarkus-integration-test-main-ext</artifactId>
+                <artifactId>camel-quarkus-integration-test-core-main-ext</artifactId>
                 <version>${project.version}</version>
             </dependency>
         </dependencies>
diff --git a/integration-tests/main/runtime/pom.xml b/integration-tests/core-main/runtime/pom.xml
similarity index 87%
rename from integration-tests/main/runtime/pom.xml
rename to integration-tests/core-main/runtime/pom.xml
index 8873355..51005dc 100644
--- a/integration-tests/main/runtime/pom.xml
+++ b/integration-tests/core-main/runtime/pom.xml
@@ -20,13 +20,13 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>org.apache.camel.quarkus</groupId>
-        <artifactId>camel-quarkus-integration-test-main-parent</artifactId>
+        <artifactId>camel-quarkus-integration-test-core-main-parent</artifactId>
         <version>0.2.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>camel-quarkus-integration-test-main-ext</artifactId>
-    <name>Camel Quarkus :: Integration Tests :: Main :: Extension :: Runtime</name>
+    <artifactId>camel-quarkus-integration-test-core-main-ext</artifactId>
+    <name>Camel Quarkus :: Integration Tests :: Core Main :: Extension :: Runtime</name>
     <description>A test extension</description>
 
     <dependencyManagement>
@@ -46,10 +46,6 @@
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-core</artifactId>
         </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-main</artifactId>
-        </dependency>
     </dependencies>
 
     <build>
diff --git a/integration-tests/main/runtime/src/main/java/org/apache/camel/quarkus/main/support/SupportListener.java b/integration-tests/core-main/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/SupportListener.java
similarity index 96%
rename from integration-tests/main/runtime/src/main/java/org/apache/camel/quarkus/main/support/SupportListener.java
rename to integration-tests/core-main/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/SupportListener.java
index 15276ef..2206d7a 100644
--- a/integration-tests/main/runtime/src/main/java/org/apache/camel/quarkus/main/support/SupportListener.java
+++ b/integration-tests/core-main/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/SupportListener.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.main.support;
+package org.apache.camel.quarkus.core.runtime.support;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.builder.RouteBuilder;
diff --git a/integration-tests/main/test/pom.xml b/integration-tests/core-main/test/pom.xml
similarity index 93%
rename from integration-tests/main/test/pom.xml
rename to integration-tests/core-main/test/pom.xml
index 32df180..561ea05 100644
--- a/integration-tests/main/test/pom.xml
+++ b/integration-tests/core-main/test/pom.xml
@@ -20,19 +20,19 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>org.apache.camel.quarkus</groupId>
-        <artifactId>camel-quarkus-integration-test-main-parent</artifactId>
+        <artifactId>camel-quarkus-integration-test-core-main-parent</artifactId>
         <version>0.2.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>camel-quarkus-integration-test-main</artifactId>
-    <name>Camel Quarkus :: Integration Tests :: Main</name>
+    <artifactId>camel-quarkus-integration-test-core-main</artifactId>
+    <name>Camel Quarkus :: Integration Tests :: Core Main :: Tests</name>
     <description>The camel integration tests</description>
 
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-main</artifactId>
+            <artifactId>camel-quarkus-core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
@@ -44,7 +44,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-integration-test-main-ext</artifactId>
+            <artifactId>camel-quarkus-integration-test-core-main-ext</artifactId>
         </dependency>
 
         <dependency>
diff --git a/integration-tests/main/test/src/main/java/org/apache/camel/quarkus/main/CamelRoute.java b/integration-tests/core-main/test/src/main/java/org/apache/camel/quarkus/core/CamelRoute.java
similarity index 96%
rename from integration-tests/main/test/src/main/java/org/apache/camel/quarkus/main/CamelRoute.java
rename to integration-tests/core-main/test/src/main/java/org/apache/camel/quarkus/core/CamelRoute.java
index e43f8e5..9731e2d 100644
--- a/integration-tests/main/test/src/main/java/org/apache/camel/quarkus/main/CamelRoute.java
+++ b/integration-tests/core-main/test/src/main/java/org/apache/camel/quarkus/core/CamelRoute.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.main;
+package org.apache.camel.quarkus.core;
 
 import org.apache.camel.builder.RouteBuilder;
 
diff --git a/integration-tests/main/test/src/main/java/org/apache/camel/quarkus/main/CamelServlet.java b/integration-tests/core-main/test/src/main/java/org/apache/camel/quarkus/core/CamelServlet.java
similarity index 97%
rename from integration-tests/main/test/src/main/java/org/apache/camel/quarkus/main/CamelServlet.java
rename to integration-tests/core-main/test/src/main/java/org/apache/camel/quarkus/core/CamelServlet.java
index 4054f2f..4dd8876 100644
--- a/integration-tests/main/test/src/main/java/org/apache/camel/quarkus/main/CamelServlet.java
+++ b/integration-tests/core-main/test/src/main/java/org/apache/camel/quarkus/core/CamelServlet.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.main;
+package org.apache.camel.quarkus.core;
 
 import java.util.Set;
 import javax.enterprise.context.ApplicationScoped;
@@ -33,7 +33,6 @@ import org.apache.camel.CamelContext;
 import org.apache.camel.ExtendedCamelContext;
 import org.apache.camel.component.log.LogComponent;
 import org.apache.camel.component.timer.TimerComponent;
-import org.apache.camel.quarkus.core.runtime.CamelConfig;
 import org.apache.camel.spi.Registry;
 import org.apache.camel.support.processor.DefaultExchangeFormatter;
 
diff --git a/integration-tests/main/test/src/main/resources/application.properties b/integration-tests/core-main/test/src/main/resources/application.properties
similarity index 100%
rename from integration-tests/main/test/src/main/resources/application.properties
rename to integration-tests/core-main/test/src/main/resources/application.properties
diff --git a/integration-tests/main/test/src/test/java/org/apache/camel/quarkus/main/CamelITCase.java b/integration-tests/core-main/test/src/test/java/org/apache/camel/quarkus/core/CamelITCase.java
similarity index 95%
rename from integration-tests/main/test/src/test/java/org/apache/camel/quarkus/main/CamelITCase.java
rename to integration-tests/core-main/test/src/test/java/org/apache/camel/quarkus/core/CamelITCase.java
index 7658725..6e466d3 100644
--- a/integration-tests/main/test/src/test/java/org/apache/camel/quarkus/main/CamelITCase.java
+++ b/integration-tests/core-main/test/src/test/java/org/apache/camel/quarkus/core/CamelITCase.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.main;
+package org.apache.camel.quarkus.core;
 
 import io.quarkus.test.junit.SubstrateTest;
 
diff --git a/integration-tests/main/test/src/test/java/org/apache/camel/quarkus/main/CamelTest.java b/integration-tests/core-main/test/src/test/java/org/apache/camel/quarkus/core/CamelTest.java
similarity index 96%
rename from integration-tests/main/test/src/test/java/org/apache/camel/quarkus/main/CamelTest.java
rename to integration-tests/core-main/test/src/test/java/org/apache/camel/quarkus/core/CamelTest.java
index 9d153c2..bb2e1de 100644
--- a/integration-tests/main/test/src/test/java/org/apache/camel/quarkus/main/CamelTest.java
+++ b/integration-tests/core-main/test/src/test/java/org/apache/camel/quarkus/core/CamelTest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.main;
+package org.apache.camel.quarkus.core;
 
 import java.net.HttpURLConnection;
 import javax.ws.rs.core.MediaType;
@@ -24,7 +24,7 @@ import io.restassured.RestAssured;
 import io.restassured.http.ContentType;
 import io.restassured.path.json.JsonPath;
 import io.restassured.response.Response;
-import org.apache.camel.quarkus.main.support.SupportListener;
+import org.apache.camel.quarkus.core.runtime.support.SupportListener;
 import org.junit.jupiter.api.Test;
 
 import static org.assertj.core.api.Assertions.assertThat;
diff --git a/integration-tests/core/test/src/main/java/org/apache/camel/quarkus/core/CamelServlet.java b/integration-tests/core/test/src/main/java/org/apache/camel/quarkus/core/CamelServlet.java
index 98900e8..42f7d80 100644
--- a/integration-tests/core/test/src/main/java/org/apache/camel/quarkus/core/CamelServlet.java
+++ b/integration-tests/core/test/src/main/java/org/apache/camel/quarkus/core/CamelServlet.java
@@ -64,4 +64,11 @@ public class CamelServlet {
     public boolean lookupContext() {
         return registry.findByType(CamelContext.class).size() == 1;
     }
+
+    @Path("/registry/lookup-main")
+    @GET
+    @Produces(MediaType.TEXT_PLAIN)
+    public boolean lookupMain() {
+        return registry.findByType(CamelMain.class).size() == 1;
+    }
 }
diff --git a/integration-tests/core/test/src/main/resources/application.properties b/integration-tests/core/test/src/main/resources/application.properties
index 478adbb..baa6a6a 100644
--- a/integration-tests/core/test/src/main/resources/application.properties
+++ b/integration-tests/core/test/src/main/resources/application.properties
@@ -24,6 +24,7 @@ quarkus.log.file.enable = false
 #
 quarkus.camel.disable-xml=true
 quarkus.camel.disable-jaxb=true
+quarkus.camel.disable-main=true
 quarkus.camel.dump-routes=true
 
 #
diff --git a/integration-tests/core/test/src/test/java/org/apache/camel/quarkus/core/CamelTest.java b/integration-tests/core/test/src/test/java/org/apache/camel/quarkus/core/CamelTest.java
index d48c256..d60b7c5 100644
--- a/integration-tests/core/test/src/test/java/org/apache/camel/quarkus/core/CamelTest.java
+++ b/integration-tests/core/test/src/test/java/org/apache/camel/quarkus/core/CamelTest.java
@@ -33,6 +33,7 @@ public class CamelTest {
     public void testContainerLookupFromRegistry() {
         RestAssured.when().get("/test/registry/lookup-registry").then().body(is("true"));
         RestAssured.when().get("/test/registry/lookup-context").then().body(is("true"));
+        RestAssured.when().get("/test/registry/lookup-main").then().body(is("false"));
     }
 
     @Test
diff --git a/integration-tests/csv/pom.xml b/integration-tests/csv/pom.xml
index 5ea9fa5..6c07899 100644
--- a/integration-tests/csv/pom.xml
+++ b/integration-tests/csv/pom.xml
@@ -32,7 +32,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-main</artifactId>
+            <artifactId>camel-quarkus-core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
diff --git a/integration-tests/infinispan/pom.xml b/integration-tests/infinispan/pom.xml
index cd58924..4e18a13 100644
--- a/integration-tests/infinispan/pom.xml
+++ b/integration-tests/infinispan/pom.xml
@@ -32,7 +32,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-main</artifactId>
+            <artifactId>camel-quarkus-core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
diff --git a/integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/CamelTest.java b/integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/CamelTest.java
index ea66692..4f33ba7 100644
--- a/integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/CamelTest.java
+++ b/integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/CamelTest.java
@@ -21,7 +21,7 @@ import javax.inject.Inject;
 import io.quarkus.test.common.QuarkusTestResource;
 import io.quarkus.test.junit.QuarkusTest;
 import io.restassured.RestAssured;
-import org.apache.camel.quarkus.main.CamelMain;
+import org.apache.camel.quarkus.core.CamelMain;
 import org.infinispan.client.hotrod.RemoteCacheManager;
 import org.junit.jupiter.api.Test;
 
diff --git a/integration-tests/jdbc/pom.xml b/integration-tests/jdbc/pom.xml
index 1d512de..5cf78e4 100644
--- a/integration-tests/jdbc/pom.xml
+++ b/integration-tests/jdbc/pom.xml
@@ -32,7 +32,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-main</artifactId>
+            <artifactId>camel-quarkus-core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
diff --git a/integration-tests/mail/pom.xml b/integration-tests/mail/pom.xml
index beb0f8d..4038dde 100644
--- a/integration-tests/mail/pom.xml
+++ b/integration-tests/mail/pom.xml
@@ -32,7 +32,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-main</artifactId>
+            <artifactId>camel-quarkus-core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
diff --git a/integration-tests/microprofile-metrics/pom.xml b/integration-tests/microprofile-metrics/pom.xml
index 8469d0f..e9f92fc 100644
--- a/integration-tests/microprofile-metrics/pom.xml
+++ b/integration-tests/microprofile-metrics/pom.xml
@@ -32,7 +32,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-main</artifactId>
+            <artifactId>camel-quarkus-core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
diff --git a/integration-tests/netty-http/pom.xml b/integration-tests/netty-http/pom.xml
index 71efab8..53fffd3 100644
--- a/integration-tests/netty-http/pom.xml
+++ b/integration-tests/netty-http/pom.xml
@@ -32,7 +32,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-main</artifactId>
+            <artifactId>camel-quarkus-core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
diff --git a/integration-tests/paho/pom.xml b/integration-tests/paho/pom.xml
index 0bc2301..5cf7dfa 100644
--- a/integration-tests/paho/pom.xml
+++ b/integration-tests/paho/pom.xml
@@ -32,7 +32,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-main</artifactId>
+            <artifactId>camel-quarkus-core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
diff --git a/integration-tests/platform-http/pom.xml b/integration-tests/platform-http/pom.xml
index e4c6903..137c840 100644
--- a/integration-tests/platform-http/pom.xml
+++ b/integration-tests/platform-http/pom.xml
@@ -34,7 +34,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-main</artifactId>
+            <artifactId>camel-quarkus-core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index 5bd6c06..68a7d69 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -79,8 +79,8 @@
     <modules>
         <!-- build those first -->
         <module>core</module>
+        <module>core-main</module>
         <module>core-impl</module>
-        <module>main</module>
 
         <module>netty-http</module>
         <module>aws</module>
diff --git a/integration-tests/salesforce/pom.xml b/integration-tests/salesforce/pom.xml
index 4c65ce0..5ff5a1d 100644
--- a/integration-tests/salesforce/pom.xml
+++ b/integration-tests/salesforce/pom.xml
@@ -32,7 +32,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-main</artifactId>
+            <artifactId>camel-quarkus-core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
diff --git a/integration-tests/servlet/pom.xml b/integration-tests/servlet/pom.xml
index e3c1c5f..f17829a 100644
--- a/integration-tests/servlet/pom.xml
+++ b/integration-tests/servlet/pom.xml
@@ -45,7 +45,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-main</artifactId>
+            <artifactId>camel-quarkus-core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
diff --git a/integration-tests/twitter/pom.xml b/integration-tests/twitter/pom.xml
index 74c94dc..410e5b0 100644
--- a/integration-tests/twitter/pom.xml
+++ b/integration-tests/twitter/pom.xml
@@ -32,7 +32,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-main</artifactId>
+            <artifactId>camel-quarkus-core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
diff --git a/integration-tests/zipfile/pom.xml b/integration-tests/zipfile/pom.xml
index 900b153..a43f313 100644
--- a/integration-tests/zipfile/pom.xml
+++ b/integration-tests/zipfile/pom.xml
@@ -32,7 +32,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-main</artifactId>
+            <artifactId>camel-quarkus-core</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
diff --git a/poms/bom-deployment/pom.xml b/poms/bom-deployment/pom.xml
index 1a0cba5..c0c1090 100644
--- a/poms/bom-deployment/pom.xml
+++ b/poms/bom-deployment/pom.xml
@@ -152,11 +152,6 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.camel.quarkus</groupId>
-                <artifactId>camel-quarkus-main-deployment</artifactId>
-                <version>${camel-quarkus.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.camel.quarkus</groupId>
                 <artifactId>camel-quarkus-microprofile-metrics-deployment</artifactId>
                 <version>${project.version}</version>
             </dependency>
diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml
index 17c6434..50cc881 100644
--- a/poms/bom/pom.xml
+++ b/poms/bom/pom.xml
@@ -329,11 +329,6 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.camel.quarkus</groupId>
-                <artifactId>camel-quarkus-main</artifactId>
-                <version>${camel-quarkus.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.camel.quarkus</groupId>
                 <artifactId>camel-quarkus-netty-http</artifactId>
                 <version>${camel-quarkus.version}</version>
             </dependency>


[camel-quarkus] 06/06: remove redunand dependency on camel-quarkus-core from integration tests #9

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

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

commit 152559eea93d9380baf757732c3408b308470686
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Sat Oct 5 09:17:27 2019 +0200

    remove redunand dependency on camel-quarkus-core from integration tests #9
---
 integration-tests/aws/pom.xml                  | 4 ----
 integration-tests/bean/pom.xml                 | 4 ----
 integration-tests/core-impl/pom.xml            | 4 ----
 integration-tests/core-main/test/pom.xml       | 4 ----
 integration-tests/core/test/pom.xml            | 4 ----
 integration-tests/csv/pom.xml                  | 4 ----
 integration-tests/infinispan/pom.xml           | 4 ----
 integration-tests/jdbc/pom.xml                 | 4 ----
 integration-tests/mail/pom.xml                 | 4 ----
 integration-tests/microprofile-metrics/pom.xml | 4 ----
 integration-tests/netty-http/pom.xml           | 4 ----
 integration-tests/paho/pom.xml                 | 4 ----
 integration-tests/platform-http/pom.xml        | 4 ----
 integration-tests/salesforce/pom.xml           | 4 ----
 integration-tests/servlet/pom.xml              | 4 ----
 integration-tests/twitter/pom.xml              | 4 ----
 integration-tests/zipfile/pom.xml              | 4 ----
 17 files changed, 68 deletions(-)

diff --git a/integration-tests/aws/pom.xml b/integration-tests/aws/pom.xml
index a077bf8..2860697 100644
--- a/integration-tests/aws/pom.xml
+++ b/integration-tests/aws/pom.xml
@@ -32,10 +32,6 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-aws-s3</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/bean/pom.xml b/integration-tests/bean/pom.xml
index 33fbaff..e8d03bd 100644
--- a/integration-tests/bean/pom.xml
+++ b/integration-tests/bean/pom.xml
@@ -32,10 +32,6 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-bean</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/core-impl/pom.xml b/integration-tests/core-impl/pom.xml
index e164bb0..6959c14 100644
--- a/integration-tests/core-impl/pom.xml
+++ b/integration-tests/core-impl/pom.xml
@@ -32,10 +32,6 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-core-cloud</artifactId>
         </dependency>
     </dependencies>
diff --git a/integration-tests/core-main/test/pom.xml b/integration-tests/core-main/test/pom.xml
index 561ea05..5e079f0 100644
--- a/integration-tests/core-main/test/pom.xml
+++ b/integration-tests/core-main/test/pom.xml
@@ -32,10 +32,6 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-log</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/core/test/pom.xml b/integration-tests/core/test/pom.xml
index bec6073..b0f3d46 100644
--- a/integration-tests/core/test/pom.xml
+++ b/integration-tests/core/test/pom.xml
@@ -32,10 +32,6 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-log</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/csv/pom.xml b/integration-tests/csv/pom.xml
index 6c07899..38f2434 100644
--- a/integration-tests/csv/pom.xml
+++ b/integration-tests/csv/pom.xml
@@ -32,10 +32,6 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-csv</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/infinispan/pom.xml b/integration-tests/infinispan/pom.xml
index 4e18a13..dc9dc22 100644
--- a/integration-tests/infinispan/pom.xml
+++ b/integration-tests/infinispan/pom.xml
@@ -32,10 +32,6 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-infinispan</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/jdbc/pom.xml b/integration-tests/jdbc/pom.xml
index 5cf78e4..1a0d6a8 100644
--- a/integration-tests/jdbc/pom.xml
+++ b/integration-tests/jdbc/pom.xml
@@ -32,10 +32,6 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-jdbc</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/mail/pom.xml b/integration-tests/mail/pom.xml
index 4038dde..edac3ad 100644
--- a/integration-tests/mail/pom.xml
+++ b/integration-tests/mail/pom.xml
@@ -32,10 +32,6 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-mail</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/microprofile-metrics/pom.xml b/integration-tests/microprofile-metrics/pom.xml
index e9f92fc..a2e3cf3 100644
--- a/integration-tests/microprofile-metrics/pom.xml
+++ b/integration-tests/microprofile-metrics/pom.xml
@@ -32,10 +32,6 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-microprofile-metrics</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/netty-http/pom.xml b/integration-tests/netty-http/pom.xml
index 53fffd3..058a523 100644
--- a/integration-tests/netty-http/pom.xml
+++ b/integration-tests/netty-http/pom.xml
@@ -32,10 +32,6 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-netty-http</artifactId>
         </dependency>
 
diff --git a/integration-tests/paho/pom.xml b/integration-tests/paho/pom.xml
index 5cf7dfa..3f9f29b 100644
--- a/integration-tests/paho/pom.xml
+++ b/integration-tests/paho/pom.xml
@@ -32,10 +32,6 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-paho</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/platform-http/pom.xml b/integration-tests/platform-http/pom.xml
index 137c840..fb9e5ee 100644
--- a/integration-tests/platform-http/pom.xml
+++ b/integration-tests/platform-http/pom.xml
@@ -34,10 +34,6 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-platform-http</artifactId>
         </dependency>
 
diff --git a/integration-tests/salesforce/pom.xml b/integration-tests/salesforce/pom.xml
index 5ff5a1d..c7654b2 100644
--- a/integration-tests/salesforce/pom.xml
+++ b/integration-tests/salesforce/pom.xml
@@ -32,10 +32,6 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-salesforce</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/servlet/pom.xml b/integration-tests/servlet/pom.xml
index f17829a..a139099 100644
--- a/integration-tests/servlet/pom.xml
+++ b/integration-tests/servlet/pom.xml
@@ -45,10 +45,6 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-servlet</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/twitter/pom.xml b/integration-tests/twitter/pom.xml
index 410e5b0..7ac858b 100644
--- a/integration-tests/twitter/pom.xml
+++ b/integration-tests/twitter/pom.xml
@@ -32,10 +32,6 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-twitter</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/zipfile/pom.xml b/integration-tests/zipfile/pom.xml
index a43f313..ad92e59 100644
--- a/integration-tests/zipfile/pom.xml
+++ b/integration-tests/zipfile/pom.xml
@@ -32,10 +32,6 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-zipfile</artifactId>
         </dependency>
         <dependency>


[camel-quarkus] 01/06: Fix failing MicroProfile metrics tests

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

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

commit b6b57772cb5679e5e656898e83365e221d0fb642
Author: James Netherton <ja...@gmail.com>
AuthorDate: Thu Oct 3 14:59:10 2019 +0100

    Fix failing MicroProfile metrics tests
---
 integration-tests/microprofile-metrics/pom.xml     |  4 ++
 .../metrics/it/MicroProfileMetricsResource.java    |  7 +++
 .../metrics/it/MicroProfileMetricsTest.java        | 68 ++++++++++------------
 3 files changed, 43 insertions(+), 36 deletions(-)

diff --git a/integration-tests/microprofile-metrics/pom.xml b/integration-tests/microprofile-metrics/pom.xml
index 0e9f170..a2e3cf3 100644
--- a/integration-tests/microprofile-metrics/pom.xml
+++ b/integration-tests/microprofile-metrics/pom.xml
@@ -39,6 +39,10 @@
             <artifactId>camel-quarkus-direct</artifactId>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-log</artifactId>
+        </dependency>
+        <dependency>
             <groupId>io.quarkus</groupId>
             <artifactId>quarkus-resteasy</artifactId>
         </dependency>
diff --git a/integration-tests/microprofile-metrics/src/main/java/org/apache/camel/quarkus/component/microprofile/metrics/it/MicroProfileMetricsResource.java b/integration-tests/microprofile-metrics/src/main/java/org/apache/camel/quarkus/component/microprofile/metrics/it/MicroProfileMetricsResource.java
index bcfd8a6..9cf9c3e 100644
--- a/integration-tests/microprofile-metrics/src/main/java/org/apache/camel/quarkus/component/microprofile/metrics/it/MicroProfileMetricsResource.java
+++ b/integration-tests/microprofile-metrics/src/main/java/org/apache/camel/quarkus/component/microprofile/metrics/it/MicroProfileMetricsResource.java
@@ -73,4 +73,11 @@ public class MicroProfileMetricsResource {
         template.sendBody("direct:timer", null);
         return Response.ok().build();
     }
+
+    @Path("/log")
+    @GET
+    public Response logMessage() throws Exception {
+        template.sendBody("log:message", "Test log message");
+        return Response.ok().build();
+    }
 }
diff --git a/integration-tests/microprofile-metrics/src/test/java/org/apache/camel/quarkus/component/microprofile/metrics/it/MicroProfileMetricsTest.java b/integration-tests/microprofile-metrics/src/test/java/org/apache/camel/quarkus/component/microprofile/metrics/it/MicroProfileMetricsTest.java
index 62cf2c4..7ace97a 100644
--- a/integration-tests/microprofile-metrics/src/test/java/org/apache/camel/quarkus/component/microprofile/metrics/it/MicroProfileMetricsTest.java
+++ b/integration-tests/microprofile-metrics/src/test/java/org/apache/camel/quarkus/component/microprofile/metrics/it/MicroProfileMetricsTest.java
@@ -85,62 +85,58 @@ class MicroProfileMetricsTest {
         RestAssured.get("/microprofile-metrics/timer")
             .then()
             .statusCode(200);
-
-        Map<String, Object> routeMetrics = getMetricMapValue("'org.apache.camel.route'");
-        routeMetrics.forEach((k, v) -> {
-            if (k.startsWith("count")) {
-                assertTrue((Integer) v > 0);
-            }
-        });
+        assertTrue(getMetricIntValue("camel.route.exchanges.total", CAMEL_CONTEXT_METRIC_TAG, "routeId=route6") > 0);
     }
 
     @Test
     public void testMicroProfileMetricsMessageHistoryFactory() {
-        Map<String, Object> messageHistoryMetrics = getMetricMapValue("'org.apache.camel.message.history'");
-        messageHistoryMetrics.forEach((k, v) -> {
-            if (k.startsWith("count")) {
+        RestAssured.get("/microprofile-metrics/log")
+            .then()
+            .statusCode(200);
+
+        Map<String, Object> exchangeMetrics = getApplicationMetrics().getMap("'camel.message.history.processing'");
+        exchangeMetrics.forEach((k, v) -> {
+            if (k.startsWith("total")) {
                 assertTrue((Integer) v > 0);
             }
         });
     }
 
     @Test
-    public void testMicroProfileMetricsRouteEventNotifier() {
-        Map<String, Object> routeMetrics = getMetricMapValue("'org.apache.camel.route.total'");
-        routeMetrics.forEach((k, v) -> {
-            if (k.startsWith("current")) {
-                assertEquals(6, v);
-            }
-        });
-
-        Map<String, Object> runningRouteMetrics = getMetricMapValue("'org.apache.camel.route.running.total'");
-        runningRouteMetrics.forEach((k, v) -> {
-            if (k.startsWith("current")) {
-                assertEquals(6, v);
-            }
-        });
+    public void testMicroProfileMetricsRouteEventNotifier() throws InterruptedException {
+        assertEquals(6, getMetricIntValue("camel.route.count"));
+        assertEquals(6, getMetricIntValue("camel.route.running.count"));
     }
 
     @Test
     public void testMicroProfileMetricsExchangeEventNotifier() {
-        Map<String, Object> exchangeMetrics = getMetricMapValue("'org.apache.camel.exchange'");
-        exchangeMetrics.forEach((k, v) -> {
-            if (k.startsWith("total")) {
-                assertTrue((Integer) v > 0);
-            }
-        });
+        RestAssured.get("/microprofile-metrics/log")
+            .then()
+            .statusCode(200);
+        assertTrue(getMetricIntValue("camel.context.exchanges.total") > 0);
+    }
+
+    private int getMetricIntValue(String metricName, String... tags) {
+        return getApplicationMetrics().getInt(sanitizeMetricName(metricName, tags));
     }
 
-    private int getMetricIntValue(String metricName) {
-        return getApplicationMetrics().getInt(metricName + CAMEL_CONTEXT_METRIC_TAG);
+    private float getMetricFloatValue(String metricName, String... tags) {
+        return getApplicationMetrics().getFloat(sanitizeMetricName(metricName, tags));
     }
 
-    private float getMetricFloatValue(String metricName) {
-        return getApplicationMetrics().getFloat(metricName + CAMEL_CONTEXT_METRIC_TAG);
+    private Map<String, Object> getMetricMapValue(String metricName, String... tags) {
+        return getApplicationMetrics().getMap(sanitizeMetricName(metricName, tags));
     }
 
-    private Map<String, Object> getMetricMapValue(String metricName) {
-        return getApplicationMetrics().getMap(metricName);
+    private String sanitizeMetricName(String metricName, String... tags) {
+        if (tags.length == 0) {
+            tags = new String[] {CAMEL_CONTEXT_METRIC_TAG};
+        }
+
+        if (metricName.contains(".") && metricName.split("\\.").length > 2) {
+            return String.format("'%s%s'", metricName, String.join(";", tags));
+        }
+        return metricName + String.join(";", tags);
     }
 
     private JsonPath getApplicationMetrics() {


[camel-quarkus] 05/06: inline BeanManagerHelper in RuntimeBeanRepository #9

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

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

commit c23864cbcedafe8ad7260de65e65ef0fa07d01aa
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Sat Oct 5 09:16:50 2019 +0200

    inline BeanManagerHelper in RuntimeBeanRepository #9
---
 .../camel/quarkus/core/BeanManagerHelper.java      | 95 ----------------------
 .../camel/quarkus/core/RuntimeBeanRepository.java  | 62 +++++++++++++-
 2 files changed, 59 insertions(+), 98 deletions(-)

diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/BeanManagerHelper.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/BeanManagerHelper.java
deleted file mode 100644
index 89d87e8..0000000
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/BeanManagerHelper.java
+++ /dev/null
@@ -1,95 +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.core;
-
-import java.lang.annotation.Annotation;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-import javax.enterprise.inject.Vetoed;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
-
-import io.quarkus.arc.Arc;
-import io.quarkus.arc.ArcContainer;
-
-/**
- * Helper methods to retrieve beans from the {@link Arc} container.
- */
-@Vetoed
-final class BeanManagerHelper {
-
-    private BeanManagerHelper() {
-    }
-
-    static <T> Set<T> getReferencesByType(Class<T> type, Annotation... qualifiers) {
-        final ArcContainer container = Arc.container();
-        final BeanManager manager = container.beanManager();
-
-        return getReferencesByType(manager, type, qualifiers);
-    }
-
-    static <T> Optional<T> getReferenceByName(String name, Class<T> type) {
-        final ArcContainer container = Arc.container();
-        final BeanManager manager = container.beanManager();
-
-        return getReferenceByName(manager, name, type);
-    }
-
-    static <T> Map<String, T> getReferencesByTypeWithName(Class<T> type, Annotation... qualifiers) {
-        final ArcContainer container = Arc.container();
-        final BeanManager manager = container.beanManager();
-
-        return getReferencesByTypeWithName(manager, type, qualifiers);
-    }
-
-    static <T> Set<T> getReferencesByType(BeanManager manager, Class<T> type, Annotation... qualifiers) {
-        Set<T> answer = new HashSet<>();
-
-        for (Bean<?> bean: manager.getBeans(type, qualifiers)) {
-            T ref = getReference(manager, type, bean);
-            if (ref != null) {
-                answer.add(ref);
-            }
-        }
-
-        return answer;
-    }
-
-    static <T> Optional<T> getReferenceByName(BeanManager manager, String name, Class<T> type) {
-        return Optional.ofNullable(manager.resolve(manager.getBeans(name))).map(bean -> getReference(manager, type, bean));
-    }
-
-    static <T> T getReference(BeanManager manager, Class<T> type, Bean<?> bean) {
-        return type.cast(manager.getReference(bean, type, manager.createCreationalContext(bean)));
-    }
-
-    static <T> Map<String, T> getReferencesByTypeWithName(BeanManager manager, Class<T> type, Annotation... qualifiers) {
-        Map<String, T> answer = new HashMap<>();
-
-        for (Bean<?> bean: manager.getBeans(type, qualifiers)) {
-            T ref = getReference(manager, type, bean);
-            if (ref != null) {
-                answer.put(bean.getName(), ref);
-            }
-        }
-
-        return answer;
-    }
-}
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/RuntimeBeanRepository.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/RuntimeBeanRepository.java
index 61d5e80..d7dc274 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/RuntimeBeanRepository.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/RuntimeBeanRepository.java
@@ -16,9 +16,18 @@
  */
 package org.apache.camel.quarkus.core;
 
+import java.lang.annotation.Annotation;
+import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
+import java.util.Optional;
 import java.util.Set;
 
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+
+import io.quarkus.arc.Arc;
+import io.quarkus.arc.ArcContainer;
 import org.apache.camel.spi.BeanRepository;
 
 public final class RuntimeBeanRepository implements BeanRepository {
@@ -29,16 +38,63 @@ public final class RuntimeBeanRepository implements BeanRepository {
 
     @Override
     public <T> T lookupByNameAndType(String name, Class<T> type) {
-        return BeanManagerHelper.getReferenceByName(name, type).orElse(null);
+        final ArcContainer container = Arc.container();
+        final BeanManager manager = container.beanManager();
+
+        return getReferenceByName(manager, name, type).orElse(null);
     }
 
     @Override
     public <T> Map<String, T> findByTypeWithName(Class<T> type) {
-        return BeanManagerHelper.getReferencesByTypeWithName(type);
+        return getReferencesByTypeWithName(type);
     }
 
     @Override
     public <T> Set<T> findByType(Class<T> type) {
-        return BeanManagerHelper.getReferencesByType(type);
+        final ArcContainer container = Arc.container();
+        final BeanManager manager = container.beanManager();
+
+        return getReferencesByType(manager, type);
+    }
+
+    private static <T> Map<String, T> getReferencesByTypeWithName(Class<T> type, Annotation... qualifiers) {
+        final ArcContainer container = Arc.container();
+        final BeanManager manager = container.beanManager();
+
+        return getReferencesByTypeWithName(manager, type, qualifiers);
+    }
+
+    private static <T> Set<T> getReferencesByType(BeanManager manager, Class<T> type, Annotation... qualifiers) {
+        Set<T> answer = new HashSet<>();
+
+        for (Bean<?> bean: manager.getBeans(type, qualifiers)) {
+            T ref = getReference(manager, type, bean);
+            if (ref != null) {
+                answer.add(ref);
+            }
+        }
+
+        return answer;
+    }
+
+    private static <T> Optional<T> getReferenceByName(BeanManager manager, String name, Class<T> type) {
+        return Optional.ofNullable(manager.resolve(manager.getBeans(name))).map(bean -> getReference(manager, type, bean));
+    }
+
+    private static <T> T getReference(BeanManager manager, Class<T> type, Bean<?> bean) {
+        return type.cast(manager.getReference(bean, type, manager.createCreationalContext(bean)));
+    }
+
+    private static <T> Map<String, T> getReferencesByTypeWithName(BeanManager manager, Class<T> type, Annotation... qualifiers) {
+        Map<String, T> answer = new HashMap<>();
+
+        for (Bean<?> bean: manager.getBeans(type, qualifiers)) {
+            T ref = getReference(manager, type, bean);
+            if (ref != null) {
+                answer.put(bean.getName(), ref);
+            }
+        }
+
+        return answer;
     }
 }


[camel-quarkus] 02/06: Remove custom registry implementation #198

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

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

commit 9607e9b464531266c4e8e9c9dfff083230a50c04
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Fri Oct 4 15:17:17 2019 +0200

    Remove custom registry implementation #198
---
 .../runtime/support/RuntimeBeanRepository.java     | 44 ++++++++++
 .../core/runtime/support/RuntimeRegistry.java      | 97 ++--------------------
 2 files changed, 53 insertions(+), 88 deletions(-)

diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/RuntimeBeanRepository.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/RuntimeBeanRepository.java
new file mode 100644
index 0000000..c89aed8
--- /dev/null
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/RuntimeBeanRepository.java
@@ -0,0 +1,44 @@
+/*
+ * 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.core.runtime.support;
+
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.camel.spi.BeanRepository;
+
+public final class RuntimeBeanRepository implements BeanRepository {
+    @Override
+    public Object lookupByName(String name) {
+        return lookupByNameAndType(name, Object.class);
+    }
+
+    @Override
+    public <T> T lookupByNameAndType(String name, Class<T> type) {
+        return BeanManagerHelper.getReferenceByName(name, type).orElse(null);
+    }
+
+    @Override
+    public <T> Map<String, T> findByTypeWithName(Class<T> type) {
+        return BeanManagerHelper.getReferencesByTypeWithName(type);
+    }
+
+    @Override
+    public <T> Set<T> findByType(Class<T> type) {
+        return BeanManagerHelper.getReferencesByType(type);
+    }
+}
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/RuntimeRegistry.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/RuntimeRegistry.java
index d796c6d..a640cbf 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/RuntimeRegistry.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/RuntimeRegistry.java
@@ -16,97 +16,18 @@
  */
 package org.apache.camel.quarkus.core.runtime.support;
 
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Optional;
-import java.util.Set;
-
 import io.quarkus.runtime.RuntimeValue;
-import org.apache.camel.NoSuchBeanException;
-import org.apache.camel.spi.Registry;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A {@link Map}-based registry.
- */
-public class RuntimeRegistry extends HashMap<String, Map<Class<?>, Object>> implements Registry {
-
-    protected final Logger log = LoggerFactory.getLogger(getClass());
-
-    public void bind(String name, Object object) {
-        bind(name, object.getClass(), object);
-    }
-
-    public void bind(String name, Class<?> clazz, Object object) {
-        this.computeIfAbsent(name, k -> new HashMap<>()).put(clazz, object);
-    }
-
-    public Object lookupByName(String name) {
-        return lookupByNameAndType(name, Object.class);
-    }
-
-    public <T> T lookupByNameAndType(String name, Class<T> type) {
-        Optional<T> t = BeanManagerHelper.getReferenceByName(name, type);
-        if (t.isPresent()) {
-            return t.get();
-        }
-        Map<Class<?>, Object> map = this.get(name);
-        if (map == null) {
-            return null;
-        }
-        Object answer = map.get(type);
-        if (answer == null) {
-            for (Map.Entry<Class<?>, Object> entry : map.entrySet()) {
-                if (type.isAssignableFrom(entry.getKey())) {
-                    answer = entry.getValue();
-                    break;
-                }
-            }
-        }
-        if (answer instanceof RuntimeValue) {
-            log.debug("Creating {} for name {}", type.toString(), name);
-            answer = ((RuntimeValue) answer).getValue();
-        }
-        try {
-            return type.cast(answer);
-        } catch (Throwable e) {
-            String msg = "Found bean: " + name + " in SimpleRegistry: " + this
-                    + " of type: " + answer.getClass().getName() + " expected type was: " + type;
-            throw new NoSuchBeanException(name, msg, e);
-        }
-    }
+import org.apache.camel.support.DefaultRegistry;
 
-    public <T> Map<String, T> findByTypeWithName(Class<T> type) {
-        Map<String, T> result = new HashMap<>();
-        for (Entry<String, Map<Class<?>, Object>> entry : entrySet()) {
-            for (Object answer : entry.getValue().values()) {
-                if (answer instanceof RuntimeValue) {
-                    answer = ((RuntimeValue) answer).getValue();
-                }
-                if (type.isInstance(answer)) {
-                    result.put(entry.getKey(), type.cast(answer));
-                }
-            }
-        }
-        result.putAll(BeanManagerHelper.getReferencesByTypeWithName(type));
-        return result;
+public class RuntimeRegistry extends DefaultRegistry {
+    public RuntimeRegistry() {
+        super(new RuntimeBeanRepository());
     }
 
-    public <T> Set<T> findByType(Class<T> type) {
-        Set<T> result = new HashSet<>();
-        for (Entry<String, Map<Class<?>, Object>> entry : entrySet()) {
-            for (Object answer : entry.getValue().values()) {
-                if (answer instanceof RuntimeValue) {
-                    answer = ((RuntimeValue) answer).getValue();
-                }
-                if (type.isInstance(answer)) {
-                    result.add(type.cast(answer));
-                }
-            }
-        }
-        result.addAll(BeanManagerHelper.getReferencesByType(type));
-        return result;
+    @Override
+    public Object unwrap(Object value) {
+        return (value instanceof RuntimeValue)
+            ? ((RuntimeValue)value).getValue()
+            : value;
     }
 }


[camel-quarkus] 03/06: Use MainSupport as base for running Camel #9

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

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

commit 26770163fc57484591c22dcac22c17cfd8736b9e
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Fri Oct 4 15:18:17 2019 +0200

    Use MainSupport as base for running Camel #9
---
 .../ROOT/pages/_partials/component-extensions.adoc |   1 +
 .../quarkus/core/deployment/BuildProcessor.java    | 153 ++-----------
 ...meBuildItem.java => CamelContextBuildItem.java} |  18 +-
 ...eBuildItem.java => CamelRegistryBuildItem.java} |  18 +-
 .../quarkus/core/deployment/CamelSupport.java      |  80 +++++++
 .../core/deployment/SubstrateProcessor.java        |   4 +-
 extensions/core/runtime/pom.xml                    |   4 -
 .../camel/quarkus/core/runtime/CamelProducers.java |  43 ++--
 .../camel/quarkus/core/runtime/CamelRecorder.java  |  93 ++++----
 .../camel/quarkus/core/runtime/CamelRuntime.java   |  48 ----
 .../camel/quarkus/core/runtime/StoppedEvent.java   |  21 --
 .../camel/quarkus/core/runtime/StoppingEvent.java  |  21 --
 .../core/runtime/support/BeanManagerHelper.java    |  16 +-
 .../core/runtime/support/FastCamelContext.java     |  77 ++++---
 .../core/runtime/support/FastCamelRuntime.java     | 252 ---------------------
 .../quarkus/core/runtime/support/FastModel.java    |   1 +
 .../{core/runtime => main/deployment}/pom.xml      |  58 +----
 .../quarkus/main/deployment/BuildProcessor.java    |  77 +++++++
 .../main/deployment/CamelMainBuildItem.java}       |  17 +-
 .../deployment/CamelMainListenerBuildItem.java}    |  24 +-
 .../camel/quarkus/main/deployment/Feature.java}    |  12 +-
 .../main/deployment/SubstrateProcessor.java        |  51 +++++
 .../resources/hello.xml => extensions/main/pom.xml |  28 ++-
 extensions/{core => main}/runtime/pom.xml          |  51 +----
 .../org/apache/camel/quarkus/main/CamelMain.java   |  81 +++++++
 .../quarkus/main/CamelMainEventDispatcher.java     |  55 +++++
 .../camel/quarkus/main/CamelMainEvents.java}       |  39 +++-
 .../camel/quarkus/main/CamelMainProducers.java     |  20 +-
 .../camel/quarkus/main/CamelMainRecorder.java      |  77 +++++++
 .../http/deployment/PlatformHttpProcessor.java     |   7 +-
 .../http/runtime/PlatformHttpRecorder.java         |  13 +-
 extensions/pom.xml                                 |   1 +
 .../test/CustomDefaultServletClassTest.java        |  49 +++-
 .../component/servlet/test/MinimalConfigTest.java  |  39 +++-
 .../servlet/test/NoDefaultServletTest.java         |  47 +++-
 integration-tests/aws/pom.xml                      |   4 +
 integration-tests/bean/pom.xml                     |   4 +
 .../quarkus/component/bean/CamelResource.java      |   3 +-
 .../component/core/cdi/CamelApplication.java       |  80 -------
 .../quarkus/component/core/cdi/CamelServlet.java   |  66 ------
 .../quarkus/component/core/cdi/CamelTest.java      |  49 ----
 .../apache/camel/quarkus/core/CamelServlet.java    |  75 +-----
 .../test/src/main/resources/application.properties |  10 +-
 .../org/apache/camel/quarkus/core/CamelTest.java   |  41 +---
 integration-tests/csv/pom.xml                      |   4 +
 integration-tests/infinispan/pom.xml               |  21 +-
 .../quarkus/component/infinispan/CamelRoute.java   |  32 +--
 .../component/infinispan/CamelServlet.java}        |  23 +-
 .../src/main/resources/application.properties      |  15 +-
 ...{CamelInfinispanITCase.java => CamelTCase.java} |   2 +-
 .../{CamelInfinispanTest.java => CamelTest.java}   |  21 +-
 .../infinispan/InfinispanServerTestResource.java   |  22 +-
 integration-tests/jdbc/pom.xml                     |   4 +
 integration-tests/mail/pom.xml                     |   4 +
 .../camel/quarkus/component/mail/CamelRoute.java   |  10 +-
 .../mail/src/main/resources/application.properties |   1 -
 .../camel/quarkus/component/mail/MailTest.java     |  32 +--
 integration-tests/main/deployment/pom.xml          |  59 +++++
 .../quarkus/main/support/deployment/Feature.java   |  12 +-
 .../main/support/deployment/SupportBuildStep.java  |  12 +-
 integration-tests/main/pom.xml                     |  45 ++++
 .../main}/runtime/pom.xml                          |  48 +---
 .../quarkus/main/support/SupportListener.java      |  56 +++++
 integration-tests/{core-cdi => main/test}/pom.xml  |  27 ++-
 .../org/apache/camel/quarkus/main/CamelRoute.java  |  13 +-
 .../apache/camel/quarkus/main}/CamelServlet.java   |  57 +++--
 .../test/src/main/resources/application.properties |   6 +-
 .../apache/camel/quarkus/main}/CamelITCase.java    |   2 +-
 .../org/apache/camel/quarkus/main}/CamelTest.java  |  52 +++--
 integration-tests/microprofile-metrics/pom.xml     |   4 +
 integration-tests/netty-http/pom.xml               |   2 +-
 .../src/main/resources/application.properties      |   9 +-
 integration-tests/paho/pom.xml                     |   4 +
 integration-tests/platform-http/pom.xml            |   4 +
 .../src/main/resources/application.properties      |   4 -
 integration-tests/pom.xml                          |   2 +-
 integration-tests/salesforce/pom.xml               |   4 +
 .../quarkus/component/salesforce/CamelServlet.java |   4 +-
 integration-tests/servlet/pom.xml                  |   4 +
 integration-tests/twitter/pom.xml                  |   4 +
 integration-tests/zipfile/pom.xml                  |   4 +
 pom.xml                                            |   2 +-
 poms/bom-deployment/pom.xml                        |   5 +
 poms/bom/pom.xml                                   |  15 +-
 84 files changed, 1301 insertions(+), 1278 deletions(-)

diff --git a/docs/modules/ROOT/pages/_partials/component-extensions.adoc b/docs/modules/ROOT/pages/_partials/component-extensions.adoc
index 0481b4d..b4462be 100644
--- a/docs/modules/ROOT/pages/_partials/component-extensions.adoc
+++ b/docs/modules/ROOT/pages/_partials/component-extensions.adoc
@@ -10,6 +10,7 @@
 * `camel-quarkus-jdbc`
 * `camel-quarkus-log`
 * `camel-quarkus-mail`
+* `camel-quarkus-main`
 * `camel-quarkus-microprofile-metrics`
 * `camel-quarkus-netty-http`
 * `camel-quarkus-paho`
diff --git a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/BuildProcessor.java b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/BuildProcessor.java
index 93d9ee4..0b8b903 100644
--- a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/BuildProcessor.java
+++ b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/BuildProcessor.java
@@ -16,44 +16,24 @@
  */
 package org.apache.camel.quarkus.core.deployment;
 
-import java.io.InputStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
-import java.util.Properties;
-import java.util.Set;
-import java.util.stream.Stream;
 import javax.inject.Inject;
 
 import io.quarkus.arc.deployment.AdditionalBeanBuildItem;
 import io.quarkus.arc.deployment.BeanContainerBuildItem;
-import io.quarkus.arc.deployment.BeanContainerListenerBuildItem;
-import io.quarkus.arc.deployment.RuntimeBeanBuildItem;
 import io.quarkus.deployment.annotations.BuildProducer;
 import io.quarkus.deployment.annotations.BuildStep;
 import io.quarkus.deployment.annotations.ExecutionTime;
 import io.quarkus.deployment.annotations.Record;
 import io.quarkus.deployment.builditem.ApplicationArchivesBuildItem;
 import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
-import io.quarkus.deployment.builditem.ServiceStartBuildItem;
-import io.quarkus.deployment.builditem.ShutdownContextBuildItem;
 import io.quarkus.runtime.RuntimeValue;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.builder.AdviceWithRouteBuilder;
-import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.CamelContext;
 import org.apache.camel.quarkus.core.runtime.CamelConfig;
-import org.apache.camel.quarkus.core.runtime.CamelConfig.BuildTime;
 import org.apache.camel.quarkus.core.runtime.CamelProducers;
 import org.apache.camel.quarkus.core.runtime.CamelRecorder;
-import org.apache.camel.quarkus.core.runtime.CamelRuntime;
-import org.apache.camel.quarkus.core.runtime.support.RuntimeRegistry;
-import org.jboss.jandex.ClassInfo;
-import org.jboss.jandex.DotName;
+import org.apache.camel.spi.Registry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -67,20 +47,14 @@ class BuildProcessor {
 
     @Record(ExecutionTime.STATIC_INIT)
     @BuildStep
-    CamelRuntimeBuildItem create(
+    CamelRegistryBuildItem registry(
             CamelRecorder recorder,
-            List<CamelBeanBuildItem> camelBeans,
-            BuildProducer<RuntimeBeanBuildItem> runtimeBeans) {
+            List<CamelBeanBuildItem> registryItems) {
 
-        RuntimeRegistry registry = new RuntimeRegistry();
-        RuntimeValue<CamelRuntime> camelRuntime = recorder.create(registry);
+        RuntimeValue<Registry> registry = recorder.createRegistry();
 
-        getBuildTimeRouteBuilderClasses().forEach(
-            b -> recorder.addBuilder(camelRuntime, b)
-        );
-
-        services().filter(
-            si -> camelBeans.stream().noneMatch(
+        CamelSupport.services(applicationArchivesBuildItem).filter(
+            si -> registryItems.stream().noneMatch(
                 c -> Objects.equals(si.name, c.getName()) && c.getType().isAssignableFrom(si.type)
             )
         ).forEach(
@@ -88,130 +62,41 @@ class BuildProcessor {
                 LOGGER.debug("Binding camel service {} with type {}", si.name, si.type);
 
                 recorder.bind(
-                    camelRuntime,
+                    registry,
                     si.name,
                     si.type
                 );
             }
         );
 
-        for (CamelBeanBuildItem item: camelBeans) {
+        for (CamelBeanBuildItem item: registryItems) {
             LOGGER.debug("Binding item with name: {}, type {}", item.getName(), item.getType());
 
             recorder.bind(
-                camelRuntime,
+                registry,
                 item.getName(),
                 item.getType(),
                 item.getValue()
             );
         }
 
-        runtimeBeans.produce(RuntimeBeanBuildItem.builder(CamelRuntime.class).setRuntimeValue(camelRuntime).build());
-
-        return new CamelRuntimeBuildItem(camelRuntime);
+        return new CamelRegistryBuildItem(registry);
     }
 
     @Record(ExecutionTime.STATIC_INIT)
     @BuildStep
-    AdditionalBeanBuildItem createProducers(
-            CamelRuntimeBuildItem runtime,
+    CamelContextBuildItem context(
             CamelRecorder recorder,
-            BuildProducer<BeanContainerListenerBuildItem> listeners) {
-
-        listeners.produce(new BeanContainerListenerBuildItem(recorder.initRuntimeInjection(runtime.getRuntime())));
+            CamelRegistryBuildItem registry,
+            BeanContainerBuildItem beanContainer,
+            CamelConfig.BuildTime buildTimeConfig) {
 
-        return AdditionalBeanBuildItem.unremovableOf(CamelProducers.class);
+        RuntimeValue<CamelContext> context = recorder.createContext(registry.getRegistry(), beanContainer.getValue(), buildTimeConfig);
+        return new CamelContextBuildItem(context);
     }
 
-    @Record(ExecutionTime.STATIC_INIT)
     @BuildStep
-    void init(
-            // TODO: keep this field as we need to be sure ArC is initialized before starting events
-            //       We need to re-evaluate the need of fire events from context once doing
-            //       https://github.com/apache/camel-quarkus/issues/9
-            BeanContainerBuildItem beanContainerBuildItem,
-            CamelRuntimeBuildItem runtime,
-            CamelRecorder recorder,
-            BuildTime buildTimeConfig) {
-
-        recorder.init(runtime.getRuntime(), buildTimeConfig);
-    }
-
-    @Record(ExecutionTime.RUNTIME_INIT)
-    @BuildStep
-    void start(
-            CamelRecorder recorder,
-            CamelRuntimeBuildItem runtime,
-            ShutdownContextBuildItem shutdown,
-            // TODO: keep this list as placeholder to ensure the ArC container is fully
-            //       started before starting the runtime
-            List<ServiceStartBuildItem> startList,
-            CamelConfig.Runtime runtimeConfig)
-            throws Exception {
-
-        recorder.start(shutdown, runtime.getRuntime(), runtimeConfig);
-    }
-
-    protected Stream<String> getBuildTimeRouteBuilderClasses() {
-        Set<ClassInfo> allKnownImplementors = new HashSet<>();
-        allKnownImplementors.addAll(
-                combinedIndexBuildItem.getIndex().getAllKnownImplementors(DotName.createSimple(RoutesBuilder.class.getName())));
-        allKnownImplementors.addAll(
-                combinedIndexBuildItem.getIndex().getAllKnownSubclasses(DotName.createSimple(RouteBuilder.class.getName())));
-        allKnownImplementors.addAll(combinedIndexBuildItem.getIndex()
-                .getAllKnownSubclasses(DotName.createSimple(AdviceWithRouteBuilder.class.getName())));
-
-        return allKnownImplementors
-                .stream()
-                .filter(CamelSupport::isConcrete)
-                .filter(CamelSupport::isPublic)
-                .map(ClassInfo::toString);
-    }
-
-    protected Stream<ServiceInfo> services() {
-        return CamelSupport.resources(applicationArchivesBuildItem, CamelSupport.CAMEL_SERVICE_BASE_PATH)
-            .map(this::services)
-            .flatMap(Collection::stream);
-    }
-
-    protected List<ServiceInfo> services(Path p) {
-        List<ServiceInfo> answer = new ArrayList<>();
-
-        String name = p.getFileName().toString();
-        try (InputStream is = Files.newInputStream(p)) {
-            Properties props = new Properties();
-            props.load(is);
-            for (Map.Entry<Object, Object> entry : props.entrySet()) {
-                String k = entry.getKey().toString();
-                if (k.equals("class")) {
-                    String clazz = entry.getValue().toString();
-                    Class<?> cl = Class.forName(clazz);
-
-                    answer.add(new ServiceInfo(name, cl));
-                }
-            }
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-
-        return answer;
-    }
-
-    static class ServiceInfo {
-        final String name;
-        final Class<?> type;
-
-        public ServiceInfo(String name, Class<?> type) {
-            this.name = name;
-            this.type = type;
-        }
-
-        @Override
-        public String toString() {
-            return "ServiceInfo{"
-                + "name='" + name + '\''
-                + ", type=" + type
-                + '}';
-        }
+    void beans(BuildProducer<AdditionalBeanBuildItem> beanProducer) {
+        beanProducer.produce(AdditionalBeanBuildItem.unremovableOf(CamelProducers.class));
     }
 }
diff --git a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRuntimeBuildItem.java b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelContextBuildItem.java
similarity index 70%
copy from extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRuntimeBuildItem.java
copy to extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelContextBuildItem.java
index e199501..0ec1306 100644
--- a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRuntimeBuildItem.java
+++ b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelContextBuildItem.java
@@ -18,17 +18,19 @@ package org.apache.camel.quarkus.core.deployment;
 
 import io.quarkus.builder.item.SimpleBuildItem;
 import io.quarkus.runtime.RuntimeValue;
-import org.apache.camel.quarkus.core.runtime.CamelRuntime;
+import org.apache.camel.CamelContext;
 
-public final class CamelRuntimeBuildItem extends SimpleBuildItem {
-
-    private final RuntimeValue<CamelRuntime> runtime;
+/**
+ * Holds the {@link CamelContext} {@link RuntimeValue}.
+ */
+public final class CamelContextBuildItem extends SimpleBuildItem {
+    private final RuntimeValue<CamelContext> value;
 
-    public CamelRuntimeBuildItem(RuntimeValue<CamelRuntime> runtime) {
-        this.runtime = runtime;
+    public CamelContextBuildItem(RuntimeValue<CamelContext> value) {
+        this.value = value;
     }
 
-    public RuntimeValue<CamelRuntime> getRuntime() {
-        return runtime;
+    public RuntimeValue<CamelContext> getCamelContext() {
+        return value;
     }
 }
diff --git a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRuntimeBuildItem.java b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRegistryBuildItem.java
similarity index 71%
copy from extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRuntimeBuildItem.java
copy to extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRegistryBuildItem.java
index e199501..152fbec 100644
--- a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRuntimeBuildItem.java
+++ b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRegistryBuildItem.java
@@ -18,17 +18,19 @@ package org.apache.camel.quarkus.core.deployment;
 
 import io.quarkus.builder.item.SimpleBuildItem;
 import io.quarkus.runtime.RuntimeValue;
-import org.apache.camel.quarkus.core.runtime.CamelRuntime;
+import org.apache.camel.spi.Registry;
 
-public final class CamelRuntimeBuildItem extends SimpleBuildItem {
-
-    private final RuntimeValue<CamelRuntime> runtime;
+/**
+ * Holds the {@link Registry} {@link RuntimeValue}.
+ */
+public final class CamelRegistryBuildItem extends SimpleBuildItem {
+    private final RuntimeValue<Registry> value;
 
-    public CamelRuntimeBuildItem(RuntimeValue<CamelRuntime> runtime) {
-        this.runtime = runtime;
+    public CamelRegistryBuildItem(RuntimeValue<Registry> value) {
+        this.value = value;
     }
 
-    public RuntimeValue<CamelRuntime> getRuntime() {
-        return runtime;
+    public RuntimeValue<Registry> getRegistry() {
+        return value;
     }
 }
diff --git a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelSupport.java b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelSupport.java
index 0f19d9e..e2f6807 100644
--- a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelSupport.java
+++ b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelSupport.java
@@ -18,13 +18,26 @@ package org.apache.camel.quarkus.core.deployment;
 
 import java.io.IOError;
 import java.io.IOException;
+import java.io.InputStream;
 import java.lang.reflect.Modifier;
 import java.nio.file.Files;
 import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
 import java.util.stream.Stream;
 
 import io.quarkus.deployment.builditem.ApplicationArchivesBuildItem;
+import org.apache.camel.RoutesBuilder;
+import org.apache.camel.builder.AdviceWithRouteBuilder;
+import org.apache.camel.builder.RouteBuilder;
 import org.jboss.jandex.ClassInfo;
+import org.jboss.jandex.DotName;
+import org.jboss.jandex.IndexView;
 
 public final class CamelSupport {
     public static final String CAMEL_SERVICE_BASE_PATH = "META-INF/services/org/apache/camel";
@@ -56,4 +69,71 @@ public final class CamelSupport {
             .flatMap(CamelSupport::safeWalk)
             .filter(Files::isRegularFile);
     }
+
+    public static Stream<String> getRouteBuilderClasses(IndexView view) {
+        Set<ClassInfo> allKnownImplementors = new HashSet<>();
+        allKnownImplementors.addAll(
+            view.getAllKnownImplementors(DotName.createSimple(RoutesBuilder.class.getName())));
+        allKnownImplementors.addAll(
+            view.getAllKnownSubclasses(DotName.createSimple(RouteBuilder.class.getName())));
+        allKnownImplementors.addAll(
+            view.getAllKnownSubclasses(DotName.createSimple(AdviceWithRouteBuilder.class.getName())));
+
+        return allKnownImplementors
+            .stream()
+            .filter(CamelSupport::isConcrete)
+            .filter(CamelSupport::isPublic)
+            .map(ClassInfo::toString);
+    }
+
+    public static Stream<ServiceInfo> services(ApplicationArchivesBuildItem applicationArchivesBuildItem) {
+        return CamelSupport.resources(applicationArchivesBuildItem, CamelSupport.CAMEL_SERVICE_BASE_PATH)
+            .map(CamelSupport::services)
+            .flatMap(Collection::stream);
+    }
+
+    private static List<ServiceInfo> services(Path p) {
+        List<ServiceInfo> answer = new ArrayList<>();
+
+        String name = p.getFileName().toString();
+        try (InputStream is = Files.newInputStream(p)) {
+            Properties props = new Properties();
+            props.load(is);
+            for (Map.Entry<Object, Object> entry : props.entrySet()) {
+                String k = entry.getKey().toString();
+                if (k.equals("class")) {
+                    String clazz = entry.getValue().toString();
+                    Class<?> cl = Class.forName(clazz);
+
+                    answer.add(new ServiceInfo(name, cl));
+                }
+            }
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+
+        return answer;
+    }
+
+    /**
+     * Utility class to describe a camel service which is a result of reading
+     * services from resources belonging to META-INF/services/org/apache/camel.
+     */
+    public static class ServiceInfo {
+        public final String name;
+        public final Class<?> type;
+
+        public ServiceInfo(String name, Class<?> type) {
+            this.name = name;
+            this.type = type;
+        }
+
+        @Override
+        public String toString() {
+            return "ServiceInfo{"
+                + "name='" + name + '\''
+                + ", type=" + type
+                + '}';
+        }
+    }
 }
diff --git a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/SubstrateProcessor.java b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/SubstrateProcessor.java
index dc8420b..8d3e809 100644
--- a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/SubstrateProcessor.java
+++ b/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/SubstrateProcessor.java
@@ -44,6 +44,7 @@ import org.apache.camel.Endpoint;
 import org.apache.camel.Producer;
 import org.apache.camel.TypeConverter;
 import org.apache.camel.spi.ExchangeFormatter;
+import org.apache.camel.spi.PropertiesComponent;
 import org.apache.camel.spi.ScheduledPollConsumerScheduler;
 import org.apache.camel.spi.StreamCachingStrategy;
 import org.jboss.jandex.AnnotationTarget.Kind;
@@ -66,7 +67,8 @@ class SubstrateProcessor {
             Component.class,
             CamelContext.class,
             StreamCachingStrategy.class,
-            StreamCachingStrategy.SpoolUsedHeapMemoryLimit.class);
+            StreamCachingStrategy.SpoolUsedHeapMemoryLimit.class,
+            PropertiesComponent.class);
 
     @Inject
     BuildProducer<ReflectiveClassBuildItem> reflectiveClass;
diff --git a/extensions/core/runtime/pom.xml b/extensions/core/runtime/pom.xml
index 97b899d..caa7e0d 100644
--- a/extensions/core/runtime/pom.xml
+++ b/extensions/core/runtime/pom.xml
@@ -65,10 +65,6 @@
         </dependency>
         <dependency>
             <groupId>org.apache.camel</groupId>
-            <artifactId>camel-properties</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel</groupId>
             <artifactId>camel-caffeine-lrucache</artifactId>
         </dependency>
         <dependency>
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelProducers.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelProducers.java
index 8a90350..c97e710 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelProducers.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelProducers.java
@@ -16,51 +16,44 @@
  */
 package org.apache.camel.quarkus.core.runtime;
 
-import javax.enterprise.context.ApplicationScoped;
 import javax.enterprise.inject.Produces;
+import javax.inject.Singleton;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.ConsumerTemplate;
 import org.apache.camel.ProducerTemplate;
 import org.apache.camel.spi.Registry;
 
-@ApplicationScoped
+/**
+ * Producers of beans that are injectable via CDI.
+ */
+@Singleton
 public class CamelProducers {
+    private volatile CamelContext context;
 
-    CamelRuntime camelRuntime;
-
-    @Produces
-    public CamelContext getCamelContext() {
-        return camelRuntime.getContext();
+    public void setContext(CamelContext context) {
+        this.context = context;
     }
 
+    @Singleton
     @Produces
-    public Registry getCamelRegistry() {
-        return camelRuntime.getRegistry();
+    CamelContext camelContext() {
+        return this.context;
     }
 
+    @Singleton
     @Produces
-    public ProducerTemplate getCamelProducerTemplate() {
-        return camelRuntime.getContext().createProducerTemplate();
+    Registry camelRegistry() {
+        return this.context.getRegistry();
     }
 
     @Produces
-    public ConsumerTemplate getCamelConsumerTemplate() {
-        return camelRuntime.getContext().createConsumerTemplate();
+    ProducerTemplate camelProducerTemplate() {
+        return this.context.createProducerTemplate();
     }
 
     @Produces
-    public CamelConfig.BuildTime getCamelBuildTimeConfig() {
-        return camelRuntime.getBuildTimeConfig();
+    ConsumerTemplate camelConsumerTemplate() {
+        return this.context.createConsumerTemplate();
     }
-
-    @Produces
-    public CamelConfig.Runtime getCamelRuntimeConfig() {
-        return camelRuntime.getRuntimeConfig();
-    }
-
-    public void setCamelRuntime(CamelRuntime camelRuntime) {
-        this.camelRuntime = camelRuntime;
-    }
-
 }
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRecorder.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRecorder.java
index 891cce1..b162104 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRecorder.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRecorder.java
@@ -16,88 +16,75 @@
  */
 package org.apache.camel.quarkus.core.runtime;
 
-import io.quarkus.arc.runtime.BeanContainerListener;
+import io.quarkus.arc.runtime.BeanContainer;
 import io.quarkus.runtime.RuntimeValue;
-import io.quarkus.runtime.ShutdownContext;
 import io.quarkus.runtime.annotations.Recorder;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.quarkus.core.runtime.support.FastCamelRuntime;
+import org.apache.camel.CamelContext;
+import org.apache.camel.ExtendedCamelContext;
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.quarkus.core.runtime.support.FastCamelContext;
+import org.apache.camel.quarkus.core.runtime.support.FastModel;
+import org.apache.camel.quarkus.core.runtime.support.RuntimeRegistry;
 import org.apache.camel.spi.Registry;
+import org.graalvm.nativeimage.ImageInfo;
 
 @Recorder
 public class CamelRecorder {
-
-    public RuntimeValue<CamelRuntime> create(Registry registry) {
-
-        FastCamelRuntime fcr = new FastCamelRuntime();
-        fcr.setRegistry(registry);
-
-        return new RuntimeValue<>(fcr);
+    public RuntimeValue<Registry> createRegistry() {
+        return new RuntimeValue<>(new RuntimeRegistry());
     }
 
-    public void init(
-            RuntimeValue<CamelRuntime> runtime,
-            CamelConfig.BuildTime buildTimeConfig) {
-
-        FastCamelRuntime fcr = (FastCamelRuntime) runtime.getValue();
-        fcr.init(buildTimeConfig);
-    }
+    @SuppressWarnings("unchecked")
+    public RuntimeValue<CamelContext> createContext(RuntimeValue<Registry> registry, BeanContainer beanContainer, CamelConfig.BuildTime buildTimeConfig) {
+        FastCamelContext context = new FastCamelContext();
+        context.setRegistry(registry.getValue());
+        context.setLoadTypeConverters(false);
+        context.getTypeConverterRegistry().setInjector(context.getInjector());
 
-    public void start(
-            ShutdownContext shutdown,
-            RuntimeValue<CamelRuntime> runtime,
-            CamelConfig.Runtime runtimeConfig) throws Exception {
-
-        runtime.getValue().start(runtimeConfig);
-
-        //in development mode undertow is started eagerly
-        shutdown.addShutdownTask(new Runnable() {
-            @Override
-            public void run() {
-                try {
-                    runtime.getValue().stop();
-                } catch (Exception e) {
-                    throw new RuntimeException(e);
-                }
+        try {
+            // The creation of the JAXB context is very time consuming, so always prepare it
+            // when running in native mode, but lazy create it in java mode so that we don't
+            // waste time if using java routes
+            if (buildTimeConfig.disableJaxb) {
+                context.adapt(ExtendedCamelContext.class).setModelJAXBContextFactory(() -> {
+                    throw new UnsupportedOperationException();
+                });
+            } else if (ImageInfo.inImageBuildtimeCode()) {
+                context.adapt(ExtendedCamelContext.class).getModelJAXBContextFactory().newJAXBContext();
             }
-        });
-    }
+        } catch (Exception e) {
+            throw RuntimeCamelException.wrapRuntimeCamelException(e);
+        }
 
-    public void addBuilder(
-        RuntimeValue<CamelRuntime> runtime,
-        String className) {
+        FastModel model = new FastModel(context);
 
-        FastCamelRuntime fcr = (FastCamelRuntime) runtime.getValue();
+        context.setModel(model);
+        context.init();
 
-        try {
-            fcr.getBuilders().add((RoutesBuilder) Class.forName(className).newInstance());
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
+        // register to the container
+        beanContainer.instance(CamelProducers.class).setContext(context);
+
+        return new RuntimeValue<>(context);
     }
 
     public void bind(
-        RuntimeValue<CamelRuntime> runtime,
+        RuntimeValue<Registry> runtime,
         String name,
         Class<?> type,
         Object instance) {
 
-        runtime.getValue().getRegistry().bind(name, type, instance);
+        runtime.getValue().bind(name, type, instance);
     }
 
     public void bind(
-        RuntimeValue<CamelRuntime> runtime,
+        RuntimeValue<Registry> runtime,
         String name,
         Class<?> type) {
 
         try {
-            runtime.getValue().getRegistry().bind(name, type, type.newInstance());
+            runtime.getValue().bind(name, type, type.newInstance());
         } catch (Exception e) {
             throw new RuntimeException(e);
         }
     }
-
-    public BeanContainerListener initRuntimeInjection(RuntimeValue<CamelRuntime> runtime) {
-        return container -> container.instance(CamelProducers.class).setCamelRuntime(runtime.getValue());
-    }
 }
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRuntime.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRuntime.java
deleted file mode 100644
index 7158d55..0000000
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/CamelRuntime.java
+++ /dev/null
@@ -1,48 +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.core.runtime;
-
-import java.util.Properties;
-
-import org.apache.camel.CamelContext;
-import org.apache.camel.spi.Registry;
-
-public interface CamelRuntime {
-
-    String PFX_CAMEL = "camel.";
-    String PFX_CAMEL_PROPERTIES = PFX_CAMEL + "component.properties.";
-    String PFX_CAMEL_CONTEXT = PFX_CAMEL + "context.";
-
-    CamelContext getContext();
-
-    Registry getRegistry();
-
-    CamelConfig.BuildTime getBuildTimeConfig();
-
-    CamelConfig.Runtime getRuntimeConfig();
-
-    void init(CamelConfig.BuildTime buildTimeConfig);
-
-    void start(CamelConfig.Runtime runtimeConfig) throws Exception;
-
-    void stop() throws Exception;
-
-    void addProperties(Properties properties);
-
-    void addProperty(String key, Object value);
-
-}
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/StoppedEvent.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/StoppedEvent.java
deleted file mode 100644
index 77f4678..0000000
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/StoppedEvent.java
+++ /dev/null
@@ -1,21 +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.core.runtime;
-
-public class StoppedEvent {
-
-}
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/StoppingEvent.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/StoppingEvent.java
deleted file mode 100644
index 6435f14..0000000
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/StoppingEvent.java
+++ /dev/null
@@ -1,21 +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.core.runtime;
-
-public class StoppingEvent {
-
-}
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/BeanManagerHelper.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/BeanManagerHelper.java
index 541d6a7..2051c6c 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/BeanManagerHelper.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/BeanManagerHelper.java
@@ -27,7 +27,11 @@ import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.BeanManager;
 
 import io.quarkus.arc.Arc;
+import io.quarkus.arc.ArcContainer;
 
+/**
+ * Helper methods to retrieve beans from the {@link Arc} container.
+ */
 @Vetoed
 final class BeanManagerHelper {
 
@@ -35,17 +39,23 @@ final class BeanManagerHelper {
     }
 
     static <T> Set<T> getReferencesByType(Class<T> type, Annotation... qualifiers) {
-        BeanManager manager = Arc.container().beanManager();
+        final ArcContainer container = Arc.container();
+        final BeanManager manager = container.beanManager();
+
         return getReferencesByType(manager, type, qualifiers);
     }
 
     static <T> Optional<T> getReferenceByName(String name, Class<T> type) {
-        BeanManager manager = Arc.container().beanManager();
+        final ArcContainer container = Arc.container();
+        final BeanManager manager = container.beanManager();
+
         return getReferenceByName(manager, name, type);
     }
 
     static <T> Map<String, T> getReferencesByTypeWithName(Class<T> type, Annotation... qualifiers) {
-        BeanManager manager = Arc.container().beanManager();
+        final ArcContainer container = Arc.container();
+        final BeanManager manager = container.beanManager();
+
         return getReferencesByTypeWithName(manager, type, qualifiers);
     }
 
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelContext.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelContext.java
index 8bc1476..1096806 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelContext.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelContext.java
@@ -18,18 +18,18 @@ package org.apache.camel.quarkus.core.runtime.support;
 
 import java.util.Collection;
 import java.util.Map;
-import java.util.Properties;
 import java.util.concurrent.ExecutorService;
 
 import org.apache.camel.AsyncProcessor;
 import org.apache.camel.CamelContext;
-import org.apache.camel.CamelContextAware;
 import org.apache.camel.Component;
 import org.apache.camel.Endpoint;
 import org.apache.camel.PollingConsumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.TypeConverter;
+import org.apache.camel.component.microprofile.config.CamelMicroProfilePropertiesSource;
+import org.apache.camel.health.HealthCheckRegistry;
 import org.apache.camel.impl.DefaultExecutorServiceManager;
 import org.apache.camel.impl.DefaultModelJAXBContextFactory;
 import org.apache.camel.impl.converter.DefaultTypeConverter;
@@ -61,10 +61,11 @@ import org.apache.camel.impl.engine.HeadersMapFactoryResolver;
 import org.apache.camel.impl.engine.ReactiveExecutorResolver;
 import org.apache.camel.impl.engine.RestRegistryFactoryResolver;
 import org.apache.camel.impl.engine.ServicePool;
+import org.apache.camel.impl.health.DefaultHealthCheckRegistry;
 import org.apache.camel.impl.transformer.TransformerKey;
 import org.apache.camel.impl.validator.ValidatorKey;
+import org.apache.camel.model.Model;
 import org.apache.camel.processor.MulticastProcessor;
-import org.apache.camel.quarkus.core.runtime.CamelRuntime;
 import org.apache.camel.quarkus.core.runtime.support.FastModel.FastRouteContext;
 import org.apache.camel.spi.AsyncProcessorAwaitManager;
 import org.apache.camel.spi.BeanIntrospection;
@@ -90,6 +91,7 @@ import org.apache.camel.spi.ModelJAXBContextFactory;
 import org.apache.camel.spi.NodeIdFactory;
 import org.apache.camel.spi.PackageScanClassResolver;
 import org.apache.camel.spi.ProcessorFactory;
+import org.apache.camel.spi.PropertiesComponent;
 import org.apache.camel.spi.ReactiveExecutor;
 import org.apache.camel.spi.Registry;
 import org.apache.camel.spi.RestRegistryFactory;
@@ -102,14 +104,16 @@ import org.apache.camel.spi.TypeConverterRegistry;
 import org.apache.camel.spi.UnitOfWorkFactory;
 import org.apache.camel.spi.UuidGenerator;
 import org.apache.camel.spi.ValidatorRegistry;
-import org.apache.camel.support.PropertyBindingSupport;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 public class FastCamelContext extends AbstractCamelContext {
+    public static final String PFX_CAMEL = "camel.";
+    public static final String PFX_CAMEL_CONTEXT = PFX_CAMEL + "context.";
+    public static final String PFX_CAMEL_PROPERTIES = PFX_CAMEL + "component.properties.";
     private static final Logger LOG = LoggerFactory.getLogger(FastCamelContext.class);
 
-    private Object model;
+    private Model model;
 
     public FastCamelContext() {
         super(false);
@@ -117,9 +121,11 @@ public class FastCamelContext extends AbstractCamelContext {
         setTracing(Boolean.FALSE);
         setDebugging(Boolean.FALSE);
         setMessageHistory(Boolean.FALSE);
+
+        setDefaultExtension(HealthCheckRegistry.class, DefaultHealthCheckRegistry::new);
     }
 
-    public void setModel(Object model) {
+    public void setModel(Model model) {
         this.model = model;
     }
 
@@ -131,6 +137,13 @@ public class FastCamelContext extends AbstractCamelContext {
     }
 
     @Override
+    protected void startRouteDefinitions() throws Exception {
+        if (model != null) {
+            model.startRouteDefinitions();
+        }
+    }
+
+    @Override
     public <T> T getExtension(Class<T> type) {
         if (type.isInstance(model)) {
             return type.cast(model);
@@ -160,12 +173,18 @@ public class FastCamelContext extends AbstractCamelContext {
 
     @Override
     protected ComponentResolver createComponentResolver() {
-        return (name, context) -> resolve(Component.class, "component", name, context);
+        // components are automatically discovered by build steps so we can reduce the
+        // operations done by the standard resolver by looking them up directly from the
+        // registry
+        return (name, context) -> context.getRegistry().lookupByNameAndType(name, Component.class);
     }
 
     @Override
     protected LanguageResolver createLanguageResolver() {
-        return (name, context) -> resolve(Language.class, "language", name, context);
+        // languages are automatically discovered by build steps so we can reduce the
+        // operations done by the standard resolver by looking them up directly from the
+        // registry
+        return (name, context) -> context.getRegistry().lookupByNameAndType(name, Language.class);
     }
 
     @Override
@@ -178,7 +197,10 @@ public class FastCamelContext extends AbstractCamelContext {
 
             @Override
             public DataFormat createDataFormat(String name, CamelContext context) {
-                return resolve(DataFormat.class, "dataformat", name, context);
+                // data formats are automatically discovered by build steps so we can reduce the
+                // operations done by the standard resolver by looking them up directly from the
+                // registry
+                return context.getRegistry().lookupByNameAndType(name, DataFormat.class);
             }
         };
     }
@@ -187,8 +209,11 @@ public class FastCamelContext extends AbstractCamelContext {
     protected TypeConverter createTypeConverter() {
         // lets use the new fast type converter registry
         return new DefaultTypeConverter(
-                this, getPackageScanClassResolver(),
-                getInjector(), getDefaultFactoryFinder(), isLoadTypeConverters());
+            this,
+            getPackageScanClassResolver(),
+            getInjector(),
+            getDefaultFactoryFinder(),
+            isLoadTypeConverters());
     }
 
     @Override
@@ -305,6 +330,15 @@ public class FastCamelContext extends AbstractCamelContext {
     }
 
     @Override
+    protected PropertiesComponent createPropertiesComponent() {
+        org.apache.camel.component.properties.PropertiesComponent pc = new org.apache.camel.component.properties.PropertiesComponent();
+        pc.setAutoDiscoverPropertiesSources(false);
+        pc.addPropertiesSource(new CamelMicroProfilePropertiesSource());
+
+        return pc;
+    }
+
+    @Override
     protected Tracer createTracer() {
         Tracer tracer = null;
         if (getRegistry() != null) {
@@ -362,27 +396,6 @@ public class FastCamelContext extends AbstractCamelContext {
                 false, false, 0L, null, false, false);
     }
 
-    @SuppressWarnings("unchecked")
-    protected <T> T resolve(Class<T> clazz, String type, String name, CamelContext context) {
-        final T result = context.getRegistry().lookupByNameAndType(name, clazz);
-        final String prefix = CamelRuntime.PFX_CAMEL + type + "." + name + ".";
-        final Properties props = getPropertiesComponent().loadProperties(k -> k.startsWith(prefix));
-
-        CamelContextAware.trySetCamelContext(result, context);
-
-        if (!props.isEmpty()) {
-            PropertyBindingSupport.build()
-                .withCamelContext(context)
-                .withOptionPrefix(prefix)
-                .withRemoveParameters(false)
-                .withProperties((Map) props)
-                .withTarget(result)
-                .bind();
-        }
-
-        return result;
-    }
-
     @Override
     public void doInit() throws Exception {
         super.doInit();
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelRuntime.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelRuntime.java
deleted file mode 100644
index 0858de4..0000000
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastCamelRuntime.java
+++ /dev/null
@@ -1,252 +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.core.runtime.support;
-
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.stream.Collectors;
-
-import io.quarkus.arc.Arc;
-import io.quarkus.runtime.RuntimeValue;
-import org.apache.camel.CamelContext;
-import org.apache.camel.ExtendedCamelContext;
-import org.apache.camel.Route;
-import org.apache.camel.RoutesBuilder;
-import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.component.microprofile.config.CamelMicroProfilePropertiesSource;
-import org.apache.camel.component.properties.PropertiesComponent;
-import org.apache.camel.model.Model;
-import org.apache.camel.quarkus.core.runtime.CamelConfig.BuildTime;
-import org.apache.camel.quarkus.core.runtime.CamelConfig.Runtime;
-import org.apache.camel.quarkus.core.runtime.CamelRuntime;
-import org.apache.camel.quarkus.core.runtime.InitializedEvent;
-import org.apache.camel.quarkus.core.runtime.InitializingEvent;
-import org.apache.camel.quarkus.core.runtime.StartedEvent;
-import org.apache.camel.quarkus.core.runtime.StartingEvent;
-import org.apache.camel.quarkus.core.runtime.StoppedEvent;
-import org.apache.camel.quarkus.core.runtime.StoppingEvent;
-import org.apache.camel.spi.Registry;
-import org.apache.camel.support.PropertyBindingSupport;
-import org.apache.camel.support.ResourceHelper;
-import org.apache.camel.util.ObjectHelper;
-import org.graalvm.nativeimage.ImageInfo;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class FastCamelRuntime implements CamelRuntime {
-    private static final Logger LOG = LoggerFactory.getLogger(FastCamelRuntime.class);
-
-    protected CamelContext context;
-    protected Registry registry;
-    protected List<RoutesBuilder> builders = new ArrayList<>();
-    protected BuildTime buildTimeConfig;
-    protected Runtime runtimeConfig;
-
-    @Override
-    public void init(BuildTime buildTimeConfig) {
-        this.buildTimeConfig = buildTimeConfig;
-        doInit();
-    }
-
-    @Override
-    public void start(Runtime runtimeConfig) throws Exception {
-        this.runtimeConfig = runtimeConfig;
-        doStart();
-    }
-
-    @Override
-    public void stop() throws Exception {
-        doStop();
-    }
-
-    @SuppressWarnings("unchecked")
-    public void doInit() {
-        try {
-            context = createContext();
-            context.setLoadTypeConverters(false);
-            context.getTypeConverterRegistry().setInjector(context.getInjector());
-
-            fireEvent(InitializingEvent.class, new InitializingEvent());
-            if (buildTimeConfig.disableJaxb) {
-                context.adapt(ExtendedCamelContext.class).setModelJAXBContextFactory(() -> {
-                    throw new UnsupportedOperationException();
-                });
-            } else {
-                // The creation of the JAXB context is very time consuming, so always prepare it
-                // when running in native mode, but lazy create it in java mode so that we don't
-                // waste time if using java routes
-                if (ImageInfo.inImageBuildtimeCode()) {
-                    context.adapt(ExtendedCamelContext.class).getModelJAXBContextFactory().newJAXBContext();
-                }
-            }
-
-            context.init();
-
-            /* Create the model before firing InitializedEvent so that the listeners can add routes */
-            FastModel model = new FastModel(context);
-            context.adapt(FastCamelContext.class).setModel(model);
-
-            fireEvent(InitializedEvent.class, new InitializedEvent());
-        } catch (Exception e) {
-            throw RuntimeCamelException.wrapRuntimeCamelException(e);
-        }
-    }
-
-    public void doStart() throws Exception {
-        fireEvent(StartingEvent.class, new StartingEvent());
-
-        loadRoutes(context);
-
-        context.start();
-        fireEvent(StartedEvent.class, new StartedEvent());
-
-        if (runtimeConfig.dumpRoutes) {
-            dumpRoutes();
-        }
-    }
-
-    protected void doStop() throws Exception {
-        fireEvent(StoppingEvent.class, new StoppingEvent());
-        context.stop();
-
-        fireEvent(StoppedEvent.class, new StoppedEvent());
-        context.shutdown();
-    }
-
-    protected void loadRoutes(CamelContext context) throws Exception {
-        final Model model = context.adapt(FastCamelContext.class).getExtension(Model.class);
-
-        for (RoutesBuilder b : builders) {
-            context.addRoutes(b);
-        }
-
-        final List<String> routesUris = buildTimeConfig.routesUris.stream()
-                .filter(ObjectHelper::isNotEmpty)
-                .collect(Collectors.toList());
-
-        if (ObjectHelper.isNotEmpty(routesUris)) {
-            LOG.debug("Loading xml routes from {}", routesUris);
-            for (String routesUri : routesUris) {
-                // TODO: if pointing to a directory, we should load all xmls in it
-                //   (maybe with glob support in it to be complete)
-                try (InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(context, routesUri.trim())) {
-                    model.addRouteDefinitions(is);
-                }
-            }
-        } else {
-            LOG.debug("No xml routes configured");
-        }
-
-        model.startRouteDefinitions();
-    }
-
-    @SuppressWarnings("unchecked")
-    protected CamelContext createContext() {
-        PropertiesComponent pc = new PropertiesComponent();
-        pc.setAutoDiscoverPropertiesSources(false);
-        pc.addPropertiesSource(new CamelMicroProfilePropertiesSource());
-
-        FastCamelContext context = new FastCamelContext();
-        context.setRegistry(registry);
-        context.addComponent("properties", pc);
-
-        PropertyBindingSupport.build()
-            .withCamelContext(context)
-            .withOptionPrefix(PFX_CAMEL_CONTEXT)
-            .withRemoveParameters(false)
-            .withProperties((Map)pc.loadProperties(k -> k.startsWith(PFX_CAMEL_CONTEXT)))
-            .withTarget(context)
-            .bind();
-
-        return context;
-    }
-
-    protected <T> void fireEvent(Class<T> clazz, T event) {
-        Arc.container().beanManager().getEvent().select(clazz).fire(event);
-    }
-
-    public void setRegistry(Registry registry) {
-        this.registry = registry;
-    }
-
-    public void setProperties(Properties properties) {
-        context.getComponent("properties", PropertiesComponent.class).setInitialProperties(properties);
-    }
-
-    @Override
-    public void addProperties(Properties properties) {
-        context.getComponent("properties", PropertiesComponent.class).getInitialProperties().putAll(properties);
-    }
-
-    @Override
-    public void addProperty(String key, Object value) {
-        context.getComponent("properties", PropertiesComponent.class).getInitialProperties().put(key, value);
-    }
-
-    public List<RoutesBuilder> getBuilders() {
-        return builders;
-    }
-
-    @SafeVarargs
-    public final void addBuilders(RoutesBuilder... builders) {
-        for (RoutesBuilder builder: builders) {
-            this.builders.add(builder);
-        }
-    }
-
-    @SafeVarargs
-    public final void addBuilders(RuntimeValue<RoutesBuilder>... builders) {
-        for (RuntimeValue<RoutesBuilder> builder: builders) {
-            this.builders.add(builder.getValue());
-        }
-    }
-
-    public CamelContext getContext() {
-        return context;
-    }
-
-    @Override
-    public Registry getRegistry() {
-        return registry;
-    }
-
-    @Override
-    public BuildTime getBuildTimeConfig() {
-        return buildTimeConfig;
-    }
-
-    @Override
-    public Runtime getRuntimeConfig() {
-        return runtimeConfig;
-    }
-
-    protected void dumpRoutes() {
-        List<Route> routes = getContext().getRoutes();
-        if (routes.isEmpty()) {
-            LOG.info("No route definitions");
-        } else {
-            LOG.info("Route definitions:");
-            for (Route route : routes) {
-                LOG.info(route.getRouteContext().getRoute().toString());
-            }
-        }
-    }
-
-}
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastModel.java b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastModel.java
index ae03794..35788a3 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastModel.java
+++ b/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/support/FastModel.java
@@ -46,6 +46,7 @@ public class FastModel extends DefaultModel {
         super(camelContext);
     }
 
+    @Override
     protected void start(RouteDefinition routeDefinition) throws Exception {
         // indicate we are staring the route using this thread so
         // we are able to query this if needed
diff --git a/extensions/core/runtime/pom.xml b/extensions/main/deployment/pom.xml
similarity index 57%
copy from extensions/core/runtime/pom.xml
copy to extensions/main/deployment/pom.xml
index 97b899d..5e7657d 100644
--- a/extensions/core/runtime/pom.xml
+++ b/extensions/main/deployment/pom.xml
@@ -18,21 +18,22 @@
 
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.camel.quarkus</groupId>
-        <artifactId>camel-quarkus-core-parent</artifactId>
+        <artifactId>camel-quarkus-main-parent</artifactId>
         <version>0.2.1-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
     </parent>
-    <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>camel-quarkus-core</artifactId>
-    <name>Camel Quarkus :: Core :: Runtime</name>
+    <artifactId>camel-quarkus-main-deployment</artifactId>
+    <name>Camel Quarkus :: Main :: Deployment</name>
 
     <dependencyManagement>
         <dependencies>
             <dependency>
                 <groupId>org.apache.camel.quarkus</groupId>
-                <artifactId>camel-quarkus-bom</artifactId>
+                <artifactId>camel-quarkus-bom-deployment</artifactId>
                 <version>${project.version}</version>
                 <type>pom</type>
                 <scope>import</scope>
@@ -42,57 +43,19 @@
 
     <dependencies>
         <dependency>
-            <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-arc</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-caffeine</artifactId>
-        </dependency>
-
-        <!-- camel -->
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-core-engine</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-base</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-properties</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-caffeine-lrucache</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-microprofile-config</artifactId>
-        </dependency>
-        <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-support-common</artifactId>
+            <artifactId>camel-quarkus-core-deployment</artifactId>
         </dependency>
-
         <dependency>
-            <groupId>com.oracle.substratevm</groupId>
-            <artifactId>svm</artifactId>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-main</artifactId>
         </dependency>
     </dependencies>
 
     <build>
         <plugins>
             <plugin>
-                <groupId>io.quarkus</groupId>
-                <artifactId>quarkus-bootstrap-maven-plugin</artifactId>
-            </plugin>
-            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
                 <configuration>
                     <annotationProcessorPaths>
@@ -106,4 +69,5 @@
             </plugin>
         </plugins>
     </build>
+
 </project>
diff --git a/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/BuildProcessor.java b/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/BuildProcessor.java
new file mode 100644
index 0000000..3ea1adf
--- /dev/null
+++ b/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/BuildProcessor.java
@@ -0,0 +1,77 @@
+/*
+ * 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.main.deployment;
+
+import java.util.List;
+
+import io.quarkus.arc.deployment.AdditionalBeanBuildItem;
+import io.quarkus.arc.deployment.BeanContainerBuildItem;
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.annotations.ExecutionTime;
+import io.quarkus.deployment.annotations.Record;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.ServiceStartBuildItem;
+import io.quarkus.deployment.builditem.ShutdownContextBuildItem;
+import io.quarkus.runtime.RuntimeValue;
+import org.apache.camel.quarkus.core.deployment.CamelContextBuildItem;
+import org.apache.camel.quarkus.core.deployment.CamelSupport;
+import org.apache.camel.quarkus.main.CamelMain;
+import org.apache.camel.quarkus.main.CamelMainProducers;
+import org.apache.camel.quarkus.main.CamelMainRecorder;
+
+public class BuildProcessor {
+    @BuildStep
+    void beans(BuildProducer<AdditionalBeanBuildItem> beanProducer) {
+        beanProducer.produce(AdditionalBeanBuildItem.unremovableOf(CamelMainProducers.class));
+    }
+
+    @Record(ExecutionTime.STATIC_INIT)
+    @BuildStep
+    CamelMainBuildItem create(
+            CombinedIndexBuildItem combinedIndexBuildItem,
+            CamelMainRecorder recorder,
+            CamelContextBuildItem context,
+            List<CamelMainListenerBuildItem> listeners,
+            BeanContainerBuildItem beanContainerBuildItem) {
+
+        RuntimeValue<CamelMain> main = recorder.createCamelMain(context.getCamelContext(), beanContainerBuildItem.getValue());
+        for (CamelMainListenerBuildItem listener: listeners) {
+            recorder.addListener(main, listener.getListener());
+        }
+
+        CamelSupport.getRouteBuilderClasses(combinedIndexBuildItem.getIndex()).forEach(name -> {
+            recorder.addRouteBuilder(main, name);
+        });
+
+        return new CamelMainBuildItem(main);
+    }
+
+    @Record(ExecutionTime.RUNTIME_INIT)
+    @BuildStep
+    void start(
+            CamelMainRecorder recorder,
+            CamelMainBuildItem main,
+            ShutdownContextBuildItem shutdown,
+            CombinedIndexBuildItem combinedIndexBuildItem,
+            // TODO: keep this list as placeholder to ensure the ArC container is fully
+            //       started before starting main
+            List<ServiceStartBuildItem> startList) {
+
+        recorder.start(shutdown, main.getInstance());
+    }
+}
diff --git a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRuntimeBuildItem.java b/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainBuildItem.java
similarity index 68%
copy from extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRuntimeBuildItem.java
copy to extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainBuildItem.java
index e199501..103c298 100644
--- a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRuntimeBuildItem.java
+++ b/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainBuildItem.java
@@ -14,21 +14,20 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core.deployment;
+package org.apache.camel.quarkus.main.deployment;
 
 import io.quarkus.builder.item.SimpleBuildItem;
 import io.quarkus.runtime.RuntimeValue;
-import org.apache.camel.quarkus.core.runtime.CamelRuntime;
+import org.apache.camel.quarkus.main.CamelMain;
 
-public final class CamelRuntimeBuildItem extends SimpleBuildItem {
+public final class CamelMainBuildItem extends SimpleBuildItem {
+    private final RuntimeValue<CamelMain> main;
 
-    private final RuntimeValue<CamelRuntime> runtime;
-
-    public CamelRuntimeBuildItem(RuntimeValue<CamelRuntime> runtime) {
-        this.runtime = runtime;
+    public CamelMainBuildItem(RuntimeValue<CamelMain> main) {
+        this.main = main;
     }
 
-    public RuntimeValue<CamelRuntime> getRuntime() {
-        return runtime;
+    public RuntimeValue<CamelMain> getInstance() {
+        return main;
     }
 }
diff --git a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRuntimeBuildItem.java b/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainListenerBuildItem.java
similarity index 59%
copy from extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRuntimeBuildItem.java
copy to extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainListenerBuildItem.java
index e199501..f7769a3 100644
--- a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRuntimeBuildItem.java
+++ b/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/CamelMainListenerBuildItem.java
@@ -14,21 +14,23 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core.deployment;
+package org.apache.camel.quarkus.main.deployment;
 
-import io.quarkus.builder.item.SimpleBuildItem;
-import io.quarkus.runtime.RuntimeValue;
-import org.apache.camel.quarkus.core.runtime.CamelRuntime;
+import io.quarkus.builder.item.MultiBuildItem;
+import org.apache.camel.main.MainListener;
+import org.apache.camel.quarkus.main.CamelMain;
 
-public final class CamelRuntimeBuildItem extends SimpleBuildItem {
-
-    private final RuntimeValue<CamelRuntime> runtime;
+/**
+ * A {@link MultiBuildItem} holding {@link MainListener}s to add to {@link CamelMain}.
+ */
+public final class CamelMainListenerBuildItem extends MultiBuildItem {
+    private final MainListener listener;
 
-    public CamelRuntimeBuildItem(RuntimeValue<CamelRuntime> runtime) {
-        this.runtime = runtime;
+    public CamelMainListenerBuildItem(MainListener listener) {
+        this.listener = listener;
     }
 
-    public RuntimeValue<CamelRuntime> getRuntime() {
-        return runtime;
+    public MainListener getListener() {
+        return listener;
     }
 }
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/StartingEvent.java b/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/Feature.java
similarity index 70%
rename from extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/StartingEvent.java
rename to extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/Feature.java
index fe67890..b731581 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/StartingEvent.java
+++ b/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/Feature.java
@@ -14,8 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core.runtime;
+package org.apache.camel.quarkus.main.deployment;
 
-public class StartingEvent {
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
 
+class Feature {
+    private static final String FEATURE = "camel-main";
+
+    @BuildStep
+    FeatureBuildItem feature() {
+        return new FeatureBuildItem(FEATURE);
+    }
 }
diff --git a/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/SubstrateProcessor.java b/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/SubstrateProcessor.java
new file mode 100644
index 0000000..8f69637
--- /dev/null
+++ b/extensions/main/deployment/src/main/java/org/apache/camel/quarkus/main/deployment/SubstrateProcessor.java
@@ -0,0 +1,51 @@
+/*
+ * 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.main.deployment;
+
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.CombinedIndexBuildItem;
+import io.quarkus.deployment.builditem.substrate.ReflectiveClassBuildItem;
+import org.apache.camel.quarkus.core.deployment.CamelSupport;
+import org.jboss.jandex.IndexView;
+
+public class SubstrateProcessor {
+    @BuildStep
+    void process(
+            CombinedIndexBuildItem combinedIndexBuildItem,
+            BuildProducer<ReflectiveClassBuildItem> reflectiveClass) {
+
+        IndexView view = combinedIndexBuildItem.getIndex();
+
+        //
+        // Register routes as reflection aware as camel-main main use reflection
+        // to bind beans to the registry
+        //
+        CamelSupport.getRouteBuilderClasses(view).forEach(name -> {
+            reflectiveClass.produce(new ReflectiveClassBuildItem(true, false, name));
+        });
+
+        reflectiveClass.produce(new ReflectiveClassBuildItem(
+            true,
+            false,
+            org.apache.camel.main.DefaultConfigurationProperties.class,
+            org.apache.camel.main.MainConfigurationProperties.class,
+            org.apache.camel.main.HystrixConfigurationProperties.class,
+            org.apache.camel.main.RestConfigurationProperties.class)
+        );
+    }
+}
diff --git a/integration-tests/core-cdi/src/main/resources/hello.xml b/extensions/main/pom.xml
similarity index 53%
rename from integration-tests/core-cdi/src/main/resources/hello.xml
rename to extensions/main/pom.xml
index 6a531a3..1d83e2f 100644
--- a/integration-tests/core-cdi/src/main/resources/hello.xml
+++ b/extensions/main/pom.xml
@@ -17,11 +17,23 @@
     limitations under the License.
 
 -->
-<routes xmlns="http://camel.apache.org/schema/spring">
-    <route id="hello">
-        <from uri="direct:hello"/>
-        <setBody>
-            <simple>hello ${body}</simple>
-        </setBody>
-    </route>
-</routes>
\ No newline at end of file
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <parent>
+        <groupId>org.apache.camel.quarkus</groupId>
+        <artifactId>camel-quarkus-build-parent</artifactId>
+        <version>0.2.1-SNAPSHOT</version>
+        <relativePath>../../poms/build-parent/pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>camel-quarkus-main-parent</artifactId>
+    <name>Camel Quarkus :: Main</name>
+    <packaging>pom</packaging>
+    <modules>
+        <module>deployment</module>
+        <module>runtime</module>
+    </modules>
+
+</project>
diff --git a/extensions/core/runtime/pom.xml b/extensions/main/runtime/pom.xml
similarity index 64%
copy from extensions/core/runtime/pom.xml
copy to extensions/main/runtime/pom.xml
index 97b899d..c9dd7ad 100644
--- a/extensions/core/runtime/pom.xml
+++ b/extensions/main/runtime/pom.xml
@@ -18,15 +18,16 @@
 
 -->
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.camel.quarkus</groupId>
-        <artifactId>camel-quarkus-core-parent</artifactId>
+        <artifactId>camel-quarkus-main-parent</artifactId>
         <version>0.2.1-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
     </parent>
-    <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>camel-quarkus-core</artifactId>
-    <name>Camel Quarkus :: Core :: Runtime</name>
+    <artifactId>camel-quarkus-main</artifactId>
+    <name>Camel Quarkus :: Main :: Runtime</name>
 
     <dependencyManagement>
         <dependencies>
@@ -42,47 +43,14 @@
 
     <dependencies>
         <dependency>
-            <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-arc</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-caffeine</artifactId>
-        </dependency>
-
-        <!-- camel -->
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-core-engine</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-base</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-properties</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-caffeine-lrucache</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-microprofile-config</artifactId>
-        </dependency>
-        <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-support-common</artifactId>
+            <artifactId>camel-quarkus-core</artifactId>
         </dependency>
 
+        <!-- Camel -->
         <dependency>
-            <groupId>com.oracle.substratevm</groupId>
-            <artifactId>svm</artifactId>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-main</artifactId>
         </dependency>
     </dependencies>
 
@@ -93,6 +61,7 @@
                 <artifactId>quarkus-bootstrap-maven-plugin</artifactId>
             </plugin>
             <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-compiler-plugin</artifactId>
                 <configuration>
                     <annotationProcessorPaths>
diff --git a/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java b/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java
new file mode 100644
index 0000000..e533f35
--- /dev/null
+++ b/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.quarkus.main;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.CamelContextAware;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.main.MainConfigurationProperties;
+import org.apache.camel.main.MainListener;
+import org.apache.camel.main.MainSupport;
+import org.apache.camel.support.service.ServiceHelper;
+
+public class CamelMain extends MainSupport implements CamelContextAware {
+    @Override
+    public void setCamelContext(CamelContext camelContext) {
+        this.camelContext = camelContext;
+    }
+
+    @Override
+    protected void doInit() throws Exception {
+        postProcessCamelContext(getCamelContext());
+    }
+
+    @Override
+    protected void doStart() throws Exception {
+        beforeStart();
+        getCamelContext().start();
+        afterStart();
+    }
+
+    @Override
+    protected void doStop() throws Exception {
+        try {
+            if (camelTemplate != null) {
+                ServiceHelper.stopService(camelTemplate);
+                camelTemplate = null;
+            }
+        } catch (Exception e) {
+            LOG.debug("Error stopping camelTemplate due " + e.getMessage() + ". This exception is ignored.", e);
+        }
+
+        beforeStop();
+        getCamelContext().stop();
+        afterStop();
+    }
+
+    @Override
+    protected ProducerTemplate findOrCreateCamelTemplate() {
+        return getCamelContext().createProducerTemplate();
+    }
+
+    @Override
+    protected CamelContext createCamelContext() {
+        throw new IllegalStateException("Should not be invoked");
+    }
+
+    Collection<MainListener> getMainListeners() {
+        return Collections.unmodifiableCollection(listeners);
+    }
+
+    MainConfigurationProperties getMainConfigurationProperties() {
+        return mainConfigurationProperties;
+    }
+}
diff --git a/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainEventDispatcher.java b/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainEventDispatcher.java
new file mode 100644
index 0000000..71de2e9
--- /dev/null
+++ b/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainEventDispatcher.java
@@ -0,0 +1,55 @@
+/*
+ * 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.main;
+
+import io.quarkus.arc.Arc;
+import org.apache.camel.CamelContext;
+import org.apache.camel.main.MainSupport;
+
+/**
+ * Bridges {@link MainSupport} events to CDI.
+ */
+public class CamelMainEventDispatcher implements org.apache.camel.main.MainListener {
+    @Override
+    public void beforeStart(MainSupport main) {
+        fireEvent(CamelMainEvents.BeforeStart.class, new CamelMainEvents.BeforeStart());
+    }
+
+    @Override
+    public void configure(CamelContext context) {
+        fireEvent(CamelMainEvents.Configure.class, new CamelMainEvents.Configure());
+    }
+
+    @Override
+    public void afterStart(MainSupport main) {
+        fireEvent(CamelMainEvents.AfterStart.class, new CamelMainEvents.AfterStart());
+    }
+
+    @Override
+    public void beforeStop(MainSupport main) {
+        fireEvent(CamelMainEvents.BeforeStop.class, new CamelMainEvents.BeforeStop());
+    }
+
+    @Override
+    public void afterStop(MainSupport main) {
+        fireEvent(CamelMainEvents.AfterStop.class, new CamelMainEvents.AfterStop());
+    }
+
+    private static <T> void fireEvent(Class<T> clazz, T event) {
+        Arc.container().beanManager().getEvent().select(clazz).fire(event);
+    }
+}
diff --git a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRuntimeBuildItem.java b/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainEvents.java
similarity index 50%
rename from extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRuntimeBuildItem.java
rename to extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainEvents.java
index e199501..19693b8 100644
--- a/extensions/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelRuntimeBuildItem.java
+++ b/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainEvents.java
@@ -14,21 +14,40 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core.deployment;
+package org.apache.camel.quarkus.main;
 
-import io.quarkus.builder.item.SimpleBuildItem;
-import io.quarkus.runtime.RuntimeValue;
-import org.apache.camel.quarkus.core.runtime.CamelRuntime;
+public final class CamelMainEvents {
+    private CamelMainEvents() {
+    }
+
+    /**
+     * Event fired by {@link CamelMain} before the CamelContext is being created and started.
+     */
+    public static class BeforeStart {
+    }
 
-public final class CamelRuntimeBuildItem extends SimpleBuildItem {
+    /**
+     * Event fired by {@link CamelMain} to configure the created CamelContext.
+     */
+    public static class Configure {
+    }
 
-    private final RuntimeValue<CamelRuntime> runtime;
+    /**
+     * Event fired by {@link CamelMain} after the CamelContext has been started.
+     */
+    public static class AfterStart {
+    }
 
-    public CamelRuntimeBuildItem(RuntimeValue<CamelRuntime> runtime) {
-        this.runtime = runtime;
+    /**
+     * Event fired by {@link CamelMain} before the CamelContext is being stopped.
+     */
+    public static class BeforeStop {
     }
 
-    public RuntimeValue<CamelRuntime> getRuntime() {
-        return runtime;
+
+    /**
+     * Event fired by {@link CamelMain} after the CamelContext has been stopped.
+     */
+    public static class AfterStop {
     }
 }
diff --git a/integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/CamelInfinispanITCase.java b/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainProducers.java
similarity index 69%
copy from integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/CamelInfinispanITCase.java
copy to extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainProducers.java
index 5718406..f830cc3 100644
--- a/integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/CamelInfinispanITCase.java
+++ b/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainProducers.java
@@ -14,10 +14,22 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.component.infinispan;
+package org.apache.camel.quarkus.main;
 
-import io.quarkus.test.junit.SubstrateTest;
+import javax.enterprise.inject.Produces;
+import javax.inject.Singleton;
 
-@SubstrateTest
-public class CamelInfinispanITCase extends CamelInfinispanTest {
+@Singleton
+public class CamelMainProducers {
+    private volatile CamelMain main;
+
+    public void setMain(CamelMain main) {
+        this.main = main;
+    }
+
+    @Singleton
+    @Produces
+    CamelMain camelMain() {
+        return this.main;
+    }
 }
diff --git a/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRecorder.java b/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRecorder.java
new file mode 100644
index 0000000..914afe9
--- /dev/null
+++ b/extensions/main/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRecorder.java
@@ -0,0 +1,77 @@
+/*
+ * 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.main;
+
+import io.quarkus.arc.runtime.BeanContainer;
+import io.quarkus.runtime.RuntimeValue;
+import io.quarkus.runtime.ShutdownContext;
+import io.quarkus.runtime.annotations.Recorder;
+import org.apache.camel.CamelContext;
+import org.apache.camel.main.MainListener;
+
+@Recorder
+public class CamelMainRecorder {
+    public RuntimeValue<CamelMain> createCamelMain(
+            RuntimeValue<CamelContext> runtime,
+            BeanContainer container) {
+
+        CamelMain main = new CamelMain();
+        main.setCamelContext(runtime.getValue());
+        main.disableHangupSupport();
+        main.addMainListener(new CamelMainEventDispatcher());
+
+        // register to the container
+        container.instance(CamelMainProducers.class).setMain(main);
+
+        return new RuntimeValue<>(main);
+    }
+
+    public void addRouteBuilder(
+            RuntimeValue<CamelMain> main,
+            String className) {
+
+        try {
+            main.getValue().addRouteBuilder(Class.forName(className));
+        } catch (Exception e) {
+            throw new RuntimeException("Could not add route builder '" + className + "'", e);
+        }
+    }
+
+    public void addListener(RuntimeValue<CamelMain> main, MainListener listener) {
+        main.getValue().addMainListener(listener);
+    }
+
+    public void start(ShutdownContext shutdown, RuntimeValue<CamelMain> main) {
+        shutdown.addShutdownTask(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    main.getValue().stop();
+                } catch (Exception e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        });
+
+        try {
+            main.getValue().init();
+            main.getValue().start();
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+}
diff --git a/extensions/platform-http/deployment/src/main/java/org/apache/camel/quarkus/component/platform/http/deployment/PlatformHttpProcessor.java b/extensions/platform-http/deployment/src/main/java/org/apache/camel/quarkus/component/platform/http/deployment/PlatformHttpProcessor.java
index 4b61333..5c6553c 100644
--- a/extensions/platform-http/deployment/src/main/java/org/apache/camel/quarkus/component/platform/http/deployment/PlatformHttpProcessor.java
+++ b/extensions/platform-http/deployment/src/main/java/org/apache/camel/quarkus/component/platform/http/deployment/PlatformHttpProcessor.java
@@ -21,9 +21,8 @@ import io.quarkus.deployment.annotations.ExecutionTime;
 import io.quarkus.deployment.annotations.Record;
 import io.quarkus.deployment.builditem.FeatureBuildItem;
 import io.quarkus.vertx.http.deployment.VertxWebRouterBuildItem;
-
 import org.apache.camel.quarkus.component.platform.http.runtime.PlatformHttpRecorder;
-import org.apache.camel.quarkus.core.deployment.CamelRuntimeBuildItem;
+import org.apache.camel.quarkus.core.deployment.CamelContextBuildItem;
 
 class PlatformHttpProcessor {
 
@@ -36,8 +35,8 @@ class PlatformHttpProcessor {
 
     @Record(ExecutionTime.RUNTIME_INIT)
     @BuildStep
-    void platformHttpComponent(PlatformHttpRecorder recorder, CamelRuntimeBuildItem runtime, VertxWebRouterBuildItem router) {
-        recorder.registerPlatformHttpComponent(runtime.getRuntime(), router.getRouter());
+    void platformHttpComponent(PlatformHttpRecorder recorder, CamelContextBuildItem context, VertxWebRouterBuildItem router) {
+        recorder.registerPlatformHttpComponent(context.getCamelContext(), router.getRouter());
     }
 
 }
diff --git a/extensions/platform-http/runtime/src/main/java/org/apache/camel/quarkus/component/platform/http/runtime/PlatformHttpRecorder.java b/extensions/platform-http/runtime/src/main/java/org/apache/camel/quarkus/component/platform/http/runtime/PlatformHttpRecorder.java
index 36ac31a..cdd68df 100644
--- a/extensions/platform-http/runtime/src/main/java/org/apache/camel/quarkus/component/platform/http/runtime/PlatformHttpRecorder.java
+++ b/extensions/platform-http/runtime/src/main/java/org/apache/camel/quarkus/component/platform/http/runtime/PlatformHttpRecorder.java
@@ -19,23 +19,20 @@ package org.apache.camel.quarkus.component.platform.http.runtime;
 import io.quarkus.runtime.RuntimeValue;
 import io.quarkus.runtime.annotations.Recorder;
 import io.vertx.ext.web.Router;
-
+import org.apache.camel.CamelContext;
 import org.apache.camel.component.platform.http.PlatformHttpComponent;
 import org.apache.camel.component.platform.http.PlatformHttpConstants;
 import org.apache.camel.component.platform.http.spi.PlatformHttpEngine;
-import org.apache.camel.quarkus.core.runtime.CamelRuntime;
-import org.apache.camel.spi.Registry;
 
 @Recorder
 public class PlatformHttpRecorder {
 
-    public void registerPlatformHttpComponent(RuntimeValue<CamelRuntime> runtime, RuntimeValue<Router> router) {
-        final Registry registry = runtime.getValue().getRegistry();
+    public void registerPlatformHttpComponent(RuntimeValue<CamelContext> context, RuntimeValue<Router> router) {
         final PlatformHttpEngine engine = new QuarkusPlatformHttpEngine(router.getValue());
-        registry.bind(PlatformHttpConstants.PLATFORM_HTTP_ENGINE_NAME, PlatformHttpEngine.class, engine);
+        context.getValue().getRegistry().bind(PlatformHttpConstants.PLATFORM_HTTP_ENGINE_NAME, PlatformHttpEngine.class, engine);
 
-        final PlatformHttpComponent component = new PlatformHttpComponent(runtime.getValue().getContext());
-        registry.bind(PlatformHttpConstants.PLATFORM_HTTP_COMPONENT_NAME, PlatformHttpComponent.class, component);
+        final PlatformHttpComponent component = new PlatformHttpComponent(context.getValue());
+        context.getValue().getRegistry().bind(PlatformHttpConstants.PLATFORM_HTTP_COMPONENT_NAME, PlatformHttpComponent.class, component);
     }
 
 }
diff --git a/extensions/pom.xml b/extensions/pom.xml
index 1096421..d2c369b 100644
--- a/extensions/pom.xml
+++ b/extensions/pom.xml
@@ -42,6 +42,7 @@
         <module>http-common</module>
 
         <!-- components -->
+        <module>main</module>
         <module>netty-http</module>
         <module>infinispan</module>
         <module>aws-s3</module>
diff --git a/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/CustomDefaultServletClassTest.java b/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/CustomDefaultServletClassTest.java
index c510be8..af5a542 100644
--- a/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/CustomDefaultServletClassTest.java
+++ b/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/CustomDefaultServletClassTest.java
@@ -16,11 +16,18 @@
  */
 package org.apache.camel.quarkus.component.servlet.test;
 
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.Properties;
+
 import io.quarkus.test.QuarkusUnitTest;
 import io.restassured.RestAssured;
 import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.impl.DefaultCamelContext;
 import org.hamcrest.core.IsEqual;
 import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.Asset;
 import org.jboss.shrinkwrap.api.asset.StringAsset;
 import org.jboss.shrinkwrap.api.spec.JavaArchive;
 import org.junit.jupiter.api.Test;
@@ -30,25 +37,45 @@ public class CustomDefaultServletClassTest {
     @RegisterExtension
     static final QuarkusUnitTest CONFIG = new QuarkusUnitTest()
         .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)
-            .addClasses(Routes.class)
-            .addAsResource(new StringAsset(
-        "quarkus.camel.servlet.url-patterns=/*\n"
-                + "quarkus.camel.servlet.servlet-name=my-named-servlet\n"
-                + "quarkus.camel.servlet.servlet-class=" + CustomServlet.class.getName() + "\n"),
-        "application.properties"));
+            .addAsResource(applicationProperties(), "application.properties"));
 
     @Test
-    public void customDefaultServletClass() {
-        RestAssured.when().get("/custom").then()
-            .body(IsEqual.equalTo("GET: /custom"))
-            .and().header("x-servlet-class-name", CustomServlet.class.getName());
+    public void customDefaultServletClass() throws Exception {
+        DefaultCamelContext context = new DefaultCamelContext();
+        context.addRoutes(new Routes());
+        context.start();
+
+        try {
+            RestAssured.when().get("/custom").then()
+                .body(IsEqual.equalTo("GET: /custom"))
+                .and().header("x-servlet-class-name", CustomServlet.class.getName());
+        } finally {
+            context.stop();
+        }
     }
 
-    public static class Routes extends RouteBuilder {
+    public static final class Routes extends RouteBuilder {
         @Override
         public void configure() {
             from("servlet://custom?servletName=my-named-servlet")
                 .setBody(constant("GET: /custom"));
         }
     }
+
+    public static final Asset applicationProperties() {
+        Writer writer = new StringWriter();
+
+        Properties props = new Properties();
+        props.setProperty("quarkus.camel.servlet.url-patterns", "/*");
+        props.setProperty("quarkus.camel.servlet.servlet-name", "my-named-servlet");
+        props.setProperty("quarkus.camel.servlet.servlet-class", CustomServlet.class.getName());
+
+        try {
+            props.store(writer, "");
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+
+        return new StringAsset(writer.toString());
+    }
 }
diff --git a/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/MinimalConfigTest.java b/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/MinimalConfigTest.java
index beefc04..544823e 100644
--- a/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/MinimalConfigTest.java
+++ b/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/MinimalConfigTest.java
@@ -16,11 +16,18 @@
  */
 package org.apache.camel.quarkus.component.servlet.test;
 
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.Properties;
+
 import io.quarkus.test.QuarkusUnitTest;
 import io.restassured.RestAssured;
 import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.impl.DefaultCamelContext;
 import org.hamcrest.core.IsEqual;
 import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.Asset;
 import org.jboss.shrinkwrap.api.asset.StringAsset;
 import org.jboss.shrinkwrap.api.spec.JavaArchive;
 import org.junit.jupiter.api.Test;
@@ -30,19 +37,41 @@ public class MinimalConfigTest {
     @RegisterExtension
     static final QuarkusUnitTest CONFIG = new QuarkusUnitTest()
         .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)
-            .addClasses(Routes.class)
-            .addAsResource(new StringAsset("quarkus.camel.servlet.url-patterns=/*\n"), "application.properties"));
+            .addAsResource(applicationProperties(), "application.properties"));
 
     @Test
-    public void minimal() {
-        RestAssured.when().get("/hello").then().body(IsEqual.equalTo("GET: /hello"));
+    public void minimal() throws Exception {
+        DefaultCamelContext context = new DefaultCamelContext();
+        context.addRoutes(new Routes());
+        context.start();
+
+        try {
+            RestAssured.when().get("/hello").then().body(IsEqual.equalTo("GET: /hello"));
+        } finally {
+            context.stop();
+        }
     }
 
-    public static class Routes extends RouteBuilder {
+    public static final class Routes extends RouteBuilder {
         @Override
         public void configure() {
             from("servlet://hello?matchOnUriPrefix=true")
                     .setBody(constant("GET: /hello"));
         }
     }
+
+    public static final Asset applicationProperties() {
+        Writer writer = new StringWriter();
+
+        Properties props = new Properties();
+        props.setProperty("quarkus.camel.servlet.url-patterns", "/*");
+
+        try {
+            props.store(writer, "");
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+
+        return new StringAsset(writer.toString());
+    }
 }
diff --git a/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/NoDefaultServletTest.java b/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/NoDefaultServletTest.java
index 30e43f3..b22bf9d 100644
--- a/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/NoDefaultServletTest.java
+++ b/extensions/servlet/deployment/src/test/java/org/apache/camel/quarkus/component/servlet/test/NoDefaultServletTest.java
@@ -16,11 +16,18 @@
  */
 package org.apache.camel.quarkus.component.servlet.test;
 
+import java.io.IOException;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.Properties;
+
 import io.quarkus.test.QuarkusUnitTest;
 import io.restassured.RestAssured;
 import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.impl.DefaultCamelContext;
 import org.hamcrest.core.IsEqual;
 import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.Asset;
 import org.jboss.shrinkwrap.api.asset.StringAsset;
 import org.jboss.shrinkwrap.api.spec.JavaArchive;
 import org.junit.jupiter.api.Test;
@@ -30,21 +37,24 @@ public class NoDefaultServletTest {
     @RegisterExtension
     static final QuarkusUnitTest CONFIG = new QuarkusUnitTest()
         .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class)
-            .addClasses(Routes.class)
-            .addAsResource(new StringAsset(
-        "quarkus.camel.servlet.my-servlet.url-patterns=/my-path/*\n"
-                + "quarkus.camel.servlet.my-servlet.servlet-class=" + CustomServlet.class.getName()
-                + "\n"),
-        "application.properties"));
+            .addAsResource(applicationProperties(), "application.properties"));
 
     @Test
-    public void noDefaultServlet() {
-        RestAssured.when().get("/my-path/custom").then()
-            .body(IsEqual.equalTo("GET: /custom"))
-            .and().header("x-servlet-class-name", CustomServlet.class.getName());
+    public void noDefaultServlet() throws Exception {
+        DefaultCamelContext context = new DefaultCamelContext();
+        context.addRoutes(new Routes());
+        context.start();
+
+        try {
+            RestAssured.when().get("/my-path/custom").then()
+                .body(IsEqual.equalTo("GET: /custom"))
+                .and().header("x-servlet-class-name", CustomServlet.class.getName());
+        } finally {
+            context.stop();
+        }
     }
 
-    public static class Routes extends RouteBuilder {
+    public static final class Routes extends RouteBuilder {
         @Override
         public void configure() {
             from("servlet://custom?servletName=my-servlet")
@@ -52,4 +62,19 @@ public class NoDefaultServletTest {
         }
     }
 
+    public static final Asset applicationProperties() {
+        Writer writer = new StringWriter();
+
+        Properties props = new Properties();
+        props.setProperty("quarkus.camel.servlet.my-servlet.url-patterns", "/my-path/*");
+        props.setProperty("quarkus.camel.servlet.my-servlet.servlet-class", CustomServlet.class.getName());
+
+        try {
+            props.store(writer, "");
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+
+        return new StringAsset(writer.toString());
+    }
 }
diff --git a/integration-tests/aws/pom.xml b/integration-tests/aws/pom.xml
index 2860697..405dccb 100644
--- a/integration-tests/aws/pom.xml
+++ b/integration-tests/aws/pom.xml
@@ -32,6 +32,10 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-main</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-aws-s3</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/bean/pom.xml b/integration-tests/bean/pom.xml
index e8d03bd..7b5ec49 100644
--- a/integration-tests/bean/pom.xml
+++ b/integration-tests/bean/pom.xml
@@ -32,6 +32,10 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-main</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-bean</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelResource.java b/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelResource.java
index e4eb030..e37d772 100644
--- a/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelResource.java
+++ b/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelResource.java
@@ -29,7 +29,6 @@ import org.apache.camel.ProducerTemplate;
 @Path("/bean")
 @ApplicationScoped
 public class CamelResource {
-
     @Inject
     ProducerTemplate template;
 
@@ -37,7 +36,7 @@ public class CamelResource {
     @POST
     @Consumes(MediaType.TEXT_PLAIN)
     @Produces(MediaType.TEXT_PLAIN)
-    public String processOrder(String statement) throws Exception {
+    public String processOrder(String statement) {
         return template.requestBody("direct:process-order", statement, String.class);
     }
 }
diff --git a/integration-tests/core-cdi/src/main/java/org/apache/camel/quarkus/component/core/cdi/CamelApplication.java b/integration-tests/core-cdi/src/main/java/org/apache/camel/quarkus/component/core/cdi/CamelApplication.java
deleted file mode 100644
index b7cd0ea..0000000
--- a/integration-tests/core-cdi/src/main/java/org/apache/camel/quarkus/component/core/cdi/CamelApplication.java
+++ /dev/null
@@ -1,80 +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.core.cdi;
-
-import java.io.InputStream;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.event.Observes;
-import javax.inject.Inject;
-
-import io.quarkus.arc.Arc;
-import io.vertx.core.Vertx;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.model.ModelHelper;
-import org.apache.camel.model.RoutesDefinition;
-import org.apache.camel.quarkus.core.runtime.CamelRuntime;
-import org.apache.camel.quarkus.core.runtime.StartedEvent;
-import org.apache.camel.quarkus.core.runtime.StartingEvent;
-import org.apache.camel.quarkus.core.runtime.StoppedEvent;
-import org.apache.camel.quarkus.core.runtime.StoppingEvent;
-
-@ApplicationScoped
-public class CamelApplication {
-    @Inject
-    CamelRuntime runtime;
-
-    public void starting(@Observes StartingEvent event) {
-        runtime.addProperty("starting", "true");
-
-        // invoking Arc.::instance(...) before the container is fully
-        // started may result in a null reference being returned
-        Vertx instance = Arc.container().instance(Vertx.class).get();
-        if (instance != null) {
-            runtime.getRegistry().bind("my-vertx", Arc.container().instance(Vertx.class).get());
-        }
-
-        addRoute("src/main/resources/hello.xml");
-    }
-
-    public void started(@Observes StartedEvent event) {
-        runtime.addProperty("started", "true");
-    }
-
-    public void stopping(@Observes StoppingEvent event) {
-    }
-
-    public void stopped(@Observes StoppedEvent event) {
-    }
-
-    private void addRoute(String path) {
-        try {
-            runtime.getContext().addRoutes(new RouteBuilder() {
-                @Override
-                public void configure() throws Exception {
-                    try (InputStream is = Files.newInputStream(Paths.get(path))) {
-                        RoutesDefinition definition = ModelHelper.loadRoutesDefinition(getContext(), is);
-                        setRouteCollection(definition);
-                    }
-                }
-            });
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-}
diff --git a/integration-tests/core-cdi/src/main/java/org/apache/camel/quarkus/component/core/cdi/CamelServlet.java b/integration-tests/core-cdi/src/main/java/org/apache/camel/quarkus/component/core/cdi/CamelServlet.java
deleted file mode 100644
index c67f476..0000000
--- a/integration-tests/core-cdi/src/main/java/org/apache/camel/quarkus/component/core/cdi/CamelServlet.java
+++ /dev/null
@@ -1,66 +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.core.cdi;
-
-import java.util.List;
-import java.util.stream.Collectors;
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Inject;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-
-import org.apache.camel.Route;
-import org.apache.camel.quarkus.core.runtime.CamelRuntime;
-
-@Path("/test")
-@ApplicationScoped
-public class CamelServlet {
-    @Inject
-    CamelRuntime runtime;
-
-    @Path("/routes")
-    @GET
-    @Produces(MediaType.TEXT_PLAIN)
-    public List<String> getRoutes() {
-        return runtime.getContext().getRoutes().stream().map(Route::getId).collect(Collectors.toList());
-    }
-
-    @Path("/property/{name}")
-    @GET
-    @Produces(MediaType.TEXT_PLAIN)
-    public String getProperty(@PathParam("name") String name) throws Exception {
-        return runtime.getContext().resolvePropertyPlaceholders("{{" + name + "}}");
-    }
-
-    @Path("/hello/{name}")
-    @GET
-    @Produces(MediaType.TEXT_PLAIN)
-    public String sayHello(@PathParam("name") String name) {
-        return runtime.getContext().createProducerTemplate().requestBody("direct:hello", name, String.class);
-    }
-
-    @Path("/registry/{name}")
-    @GET
-    @Produces(MediaType.TEXT_PLAIN)
-    public String lookupByName(@PathParam("name") String name) {
-        Object answer = runtime.getContext().getRegistry().lookupByName(name);
-        return answer != null ? answer.getClass().getName() : "";
-    }
-}
diff --git a/integration-tests/core-cdi/src/test/java/org/apache/camel/quarkus/component/core/cdi/CamelTest.java b/integration-tests/core-cdi/src/test/java/org/apache/camel/quarkus/component/core/cdi/CamelTest.java
deleted file mode 100644
index 1942e79..0000000
--- a/integration-tests/core-cdi/src/test/java/org/apache/camel/quarkus/component/core/cdi/CamelTest.java
+++ /dev/null
@@ -1,49 +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.core.cdi;
-
-import io.quarkus.test.junit.QuarkusTest;
-import io.restassured.RestAssured;
-import io.vertx.core.impl.VertxImpl;
-import org.junit.jupiter.api.Test;
-
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.is;
-
-@QuarkusTest
-public class CamelTest {
-    @Test
-    public void testRoutes() {
-        RestAssured.when().get("/test/routes").then().body(containsString("hello"));
-    }
-
-    @Test
-    public void testProperties() {
-        RestAssured.when().get("/test/property/starting").then().body(is("true"));
-        RestAssured.when().get("/test/property/started").then().body(is("true"));
-    }
-
-    @Test
-    public void testHello() {
-        RestAssured.when().get("/test/hello/quarkus").then().body(is("hello quarkus"));
-    }
-
-    @Test
-    public void restLookupBeanByName() {
-        RestAssured.when().get("/test/registry/my-vertx").then().body(is(VertxImpl.class.getName()));
-    }
-}
diff --git a/integration-tests/core/test/src/main/java/org/apache/camel/quarkus/core/CamelServlet.java b/integration-tests/core/test/src/main/java/org/apache/camel/quarkus/core/CamelServlet.java
index a88916e..98900e8 100644
--- a/integration-tests/core/test/src/main/java/org/apache/camel/quarkus/core/CamelServlet.java
+++ b/integration-tests/core/test/src/main/java/org/apache/camel/quarkus/core/CamelServlet.java
@@ -16,61 +16,31 @@
  */
 package org.apache.camel.quarkus.core;
 
-import java.util.List;
-import java.util.Set;
-import java.util.stream.Collectors;
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
 import javax.json.Json;
 import javax.json.JsonObject;
 import javax.ws.rs.GET;
-import javax.ws.rs.POST;
 import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 
-import org.apache.camel.ExtendedCamelContext;
-import org.apache.camel.Route;
+import org.apache.camel.CamelContext;
 import org.apache.camel.component.log.LogComponent;
-import org.apache.camel.component.timer.TimerComponent;
-import org.apache.camel.quarkus.core.runtime.CamelConfig;
-import org.apache.camel.quarkus.core.runtime.CamelRuntime;
+import org.apache.camel.spi.Registry;
 import org.apache.camel.support.processor.DefaultExchangeFormatter;
 
 @Path("/test")
 @ApplicationScoped
 public class CamelServlet {
     @Inject
-    CamelRuntime runtime;
-
-    @Path("/routes")
-    @GET
-    @Produces(MediaType.TEXT_PLAIN)
-    public List<String> getRoutes() {
-        return runtime.getContext().getRoutes().stream().map(Route::getId).collect(Collectors.toList());
-    }
-
-    @Path("/property/{name}")
-    @GET
-    @Produces(MediaType.TEXT_PLAIN)
-    public String getProperty(@PathParam("name") String name) throws Exception {
-        return runtime.getContext().resolvePropertyPlaceholders("{{" + name + "}}");
-    }
-
-    @Path("/timer/property-binding")
-    @GET
-    @Produces(MediaType.TEXT_PLAIN)
-    public boolean timerResolvePropertyPlaceholders() throws Exception {
-        return runtime.getContext().getComponent("timer", TimerComponent.class).isBasicPropertyBinding();
-    }
-
+    Registry registry;
 
     @Path("/registry/log/exchange-formatter")
     @GET
     @Produces(MediaType.APPLICATION_JSON)
     public JsonObject exchangeFormatterConfig() {
-        LogComponent component = runtime.getRegistry().lookupByNameAndType("log", LogComponent.class);
+        LogComponent component = registry.lookupByNameAndType("log", LogComponent.class);
         DefaultExchangeFormatter def = (DefaultExchangeFormatter)component.getExchangeFormatter();
 
         JsonObject result = Json.createObjectBuilder()
@@ -81,42 +51,17 @@ public class CamelServlet {
         return result;
     }
 
-    @Path("/registry/produces-config-build")
-    @GET
-    @Produces(MediaType.TEXT_PLAIN)
-    public boolean producesBuildTimeConfig() {
-        return lookupSingleInstanceFromRegistry(CamelConfig.BuildTime.class) != null;
-    }
-
-    @Path("/registry/produces-config-runtime")
+    @Path("/registry/lookup-registry")
     @GET
     @Produces(MediaType.TEXT_PLAIN)
-    public boolean producesRuntimeConfig() {
-        return lookupSingleInstanceFromRegistry(CamelConfig.Runtime.class) != null;
-    }
-
-    private <T> T lookupSingleInstanceFromRegistry(Class<T> type) {
-        final Set<T> answer = runtime.getContext().getRegistry().findByType(type);
-
-        if (answer.size() == 1) {
-            return answer.iterator().next();
-        }
-
-        return null;
+    public boolean lookupRegistry() {
+        return registry.findByType(Registry.class).size() == 1;
     }
 
-    @Path("/context/name")
+    @Path("/registry/lookup-context")
     @GET
     @Produces(MediaType.TEXT_PLAIN)
-    public String getCamelContextName() {
-        return runtime.getContext().getName();
-    }
-
-    @Path("/context/name")
-    @POST
-    @Produces(MediaType.TEXT_PLAIN)
-    public String setCamelContextName(String name) {
-        runtime.getContext().adapt(ExtendedCamelContext.class).setName(name);
-        return runtime.getContext().getName();
+    public boolean lookupContext() {
+        return registry.findByType(CamelContext.class).size() == 1;
     }
 }
diff --git a/integration-tests/core/test/src/main/resources/application.properties b/integration-tests/core/test/src/main/resources/application.properties
index b441636..478adbb 100644
--- a/integration-tests/core/test/src/main/resources/application.properties
+++ b/integration-tests/core/test/src/main/resources/application.properties
@@ -29,12 +29,4 @@ quarkus.camel.dump-routes=true
 #
 # Camel
 #
-camel.context.name=quarkus-camel-example
-
-# Timer
-camel.component.timer.basic-property-binding = true
-
-#
-# Integration
-#
-integration.folder={{sys:folder:./target/orders}}
\ No newline at end of file
+camel.context.name=quarkus-camel-example
\ No newline at end of file
diff --git a/integration-tests/core/test/src/test/java/org/apache/camel/quarkus/core/CamelTest.java b/integration-tests/core/test/src/test/java/org/apache/camel/quarkus/core/CamelTest.java
index 0d26aa5..d48c256 100644
--- a/integration-tests/core/test/src/test/java/org/apache/camel/quarkus/core/CamelTest.java
+++ b/integration-tests/core/test/src/test/java/org/apache/camel/quarkus/core/CamelTest.java
@@ -20,60 +20,27 @@ import java.net.HttpURLConnection;
 
 import io.quarkus.test.junit.QuarkusTest;
 import io.restassured.RestAssured;
-import io.restassured.http.ContentType;
 import io.restassured.response.Response;
 import org.junit.jupiter.api.Test;
 
-import static org.hamcrest.Matchers.containsString;
 import static org.hamcrest.Matchers.is;
 import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 @QuarkusTest
 public class CamelTest {
-
-    @Test
-    public void testRoutes() {
-        RestAssured.when().get("/test/routes").then().body(containsString("timer"));
-    }
-
-    @Test
-    public void testProperties() {
-        RestAssured.when().get("/test/property/camel.context.name").then().body(is("quarkus-camel-example"));
-        RestAssured.when().get("/test/property/camel.component.timer.basic-property-binding").then().body(is("true"));
-    }
-
-    @Test
-    public void timerPropertyPropagated() {
-        RestAssured.when().get("/test/timer/property-binding").then().body(is("true"));
-    }
-
     @Test
-    public void testRegistry() {
-        RestAssured.when().get("/test/registry/produces-config-build").then().body(is("true"));
-        RestAssured.when().get("/test/registry/produces-config-runtime").then().body(is("true"));
+    public void testContainerLookupFromRegistry() {
+        RestAssured.when().get("/test/registry/lookup-registry").then().body(is("true"));
+        RestAssured.when().get("/test/registry/lookup-context").then().body(is("true"));
     }
 
     @Test
-    public void testRegistryBuildItem() {
+    public void testCamelBeanBuildItem() {
         Response response = RestAssured.get("/test/registry/log/exchange-formatter").andReturn();
 
         assertEquals(HttpURLConnection.HTTP_OK, response.getStatusCode());
         assertTrue(response.jsonPath().getBoolean("show-all"));
         assertTrue(response.jsonPath().getBoolean("multi-line"));
     }
-
-    @Test
-    public void testSetCamelContextName() {
-        Response response = RestAssured.get("/test/context/name").andReturn();
-
-        assertEquals(HttpURLConnection.HTTP_OK, response.getStatusCode());
-        assertNotEquals("my-ctx-name", response.body().asString());
-
-        RestAssured.given()
-            .contentType(ContentType.TEXT).body("my-ctx-name")
-            .post("/test/context/name")
-            .then().body(is("my-ctx-name"));
-    }
 }
diff --git a/integration-tests/csv/pom.xml b/integration-tests/csv/pom.xml
index 38f2434..5ea9fa5 100644
--- a/integration-tests/csv/pom.xml
+++ b/integration-tests/csv/pom.xml
@@ -32,6 +32,10 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-main</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-csv</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/infinispan/pom.xml b/integration-tests/infinispan/pom.xml
index 9f3168c..cd58924 100644
--- a/integration-tests/infinispan/pom.xml
+++ b/integration-tests/infinispan/pom.xml
@@ -32,6 +32,10 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-main</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-infinispan</artifactId>
         </dependency>
         <dependency>
@@ -40,13 +44,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-netty-http</artifactId>
+            <artifactId>camel-quarkus-direct</artifactId>
         </dependency>
-
-        <!-- Undertow is here only for the test runner to be able to detect that the server has started -->
         <dependency>
             <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-undertow</artifactId>
+            <artifactId>quarkus-resteasy</artifactId>
         </dependency>
 
         <!-- test dependencies -->
@@ -77,6 +79,17 @@
             <artifactId>infinispan-server-hotrod</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.infinispan</groupId>
+            <artifactId>infinispan-remote-query-server</artifactId>
+            <exclusions>
+                <exclusion>
+                    <groupId>commons-logging</groupId>
+                    <artifactId>commons-logging</artifactId>
+                </exclusion>
+            </exclusions>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
     <build>
diff --git a/integration-tests/infinispan/src/main/java/org/apache/camel/quarkus/component/infinispan/CamelRoute.java b/integration-tests/infinispan/src/main/java/org/apache/camel/quarkus/component/infinispan/CamelRoute.java
index aa2af07..898a8c8 100644
--- a/integration-tests/infinispan/src/main/java/org/apache/camel/quarkus/component/infinispan/CamelRoute.java
+++ b/integration-tests/infinispan/src/main/java/org/apache/camel/quarkus/component/infinispan/CamelRoute.java
@@ -23,25 +23,25 @@ import org.apache.camel.component.infinispan.InfinispanConstants;
 import org.apache.camel.component.infinispan.InfinispanOperation;
 
 public class CamelRoute extends RouteBuilder {
-
     @Override
     public void configure() {
+        // we do not need to set any information about the target infinispan server
+        // as the RemoteConnectionManager is produced by the infinispan extension
+        // and camel-main automatically bind it to the component
 
-        from("netty-http:http://0.0.0.0:8999/put")
-                .convertBodyTo(byte[].class)
-                .to("log:cache?showAll=true")
-                .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.PUT)
-                .setHeader(InfinispanConstants.KEY).constant("the-key".getBytes(StandardCharsets.UTF_8))
-                .setHeader(InfinispanConstants.VALUE).body()
-                .to("infinispan:default?hosts=localhost:11232");
+        from("direct:put")
+            .convertBodyTo(byte[].class)
+            .to("log:cache?showAll=true")
+            .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.PUT)
+            .setHeader(InfinispanConstants.KEY).constant("the-key".getBytes(StandardCharsets.UTF_8))
+            .setHeader(InfinispanConstants.VALUE).body()
+            .to("infinispan:default")
+            .to("log:put?showAll=true");
 
-        from("netty-http:http://0.0.0.0:8999/get")
-                .setHeader(InfinispanConstants.OPERATION)
-                .constant(InfinispanOperation.GET)
-                .setHeader(InfinispanConstants.KEY)
-                .constant("the-key".getBytes(StandardCharsets.UTF_8))
-                .to("infinispan:default?hosts=localhost:11232")
-                .to("log:cache?showAll=true");
+        from("direct:get")
+            .setHeader(InfinispanConstants.OPERATION).constant(InfinispanOperation.GET)
+            .setHeader(InfinispanConstants.KEY).constant("the-key".getBytes(StandardCharsets.UTF_8))
+            .to("infinispan:default")
+            .to("log:get?showAll=true");
     }
-
 }
diff --git a/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelResource.java b/integration-tests/infinispan/src/main/java/org/apache/camel/quarkus/component/infinispan/CamelServlet.java
similarity index 73%
copy from integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelResource.java
copy to integration-tests/infinispan/src/main/java/org/apache/camel/quarkus/component/infinispan/CamelServlet.java
index e4eb030..6e2a0ab 100644
--- a/integration-tests/bean/src/main/java/org/apache/camel/quarkus/component/bean/CamelResource.java
+++ b/integration-tests/infinispan/src/main/java/org/apache/camel/quarkus/component/infinispan/CamelServlet.java
@@ -14,11 +14,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.component.bean;
+package org.apache.camel.quarkus.component.infinispan;
 
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
-import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
 import javax.ws.rs.POST;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
@@ -26,18 +26,23 @@ import javax.ws.rs.core.MediaType;
 
 import org.apache.camel.ProducerTemplate;
 
-@Path("/bean")
+@Path("/test")
 @ApplicationScoped
-public class CamelResource {
-
+public class CamelServlet {
     @Inject
     ProducerTemplate template;
 
-    @Path("/process-order")
+    @Path("/get")
+    @GET
+    @Produces(MediaType.TEXT_PLAIN)
+    public String get() {
+        return template.requestBody("direct:get", "", String.class);
+    }
+
+    @Path("/put")
     @POST
-    @Consumes(MediaType.TEXT_PLAIN)
     @Produces(MediaType.TEXT_PLAIN)
-    public String processOrder(String statement) throws Exception {
-        return template.requestBody("direct:process-order", statement, String.class);
+    public String put(String content) {
+        return template.requestBody("direct:put", content, String.class);
     }
 }
diff --git a/integration-tests/core-cdi/src/main/resources/application.properties b/integration-tests/infinispan/src/main/resources/application.properties
similarity index 85%
rename from integration-tests/core-cdi/src/main/resources/application.properties
rename to integration-tests/infinispan/src/main/resources/application.properties
index f258d12..21bde53 100644
--- a/integration-tests/core-cdi/src/main/resources/application.properties
+++ b/integration-tests/infinispan/src/main/resources/application.properties
@@ -20,16 +20,19 @@
 quarkus.log.file.enable = false
 
 #
+# Quarkus
+#
+quarkus.infinispan-client.server-list = localhost:11232
+quarkus.infinispan-client.near-cache-max-entries = 3
+
+#
 # Quarkus :: Camel
 #
-quarkus.camel.disable-xml=false
-quarkus.camel.disable-jaxb=false
+quarkus.camel.disable-xml=true
+quarkus.camel.disable-jaxb=true        
 quarkus.camel.dump-routes=true
+
 #
 # Camel
 #
 camel.context.name = quarkus-camel-example
-
-#
-# Integration
-#
\ No newline at end of file
diff --git a/integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/CamelInfinispanITCase.java b/integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/CamelTCase.java
similarity index 93%
rename from integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/CamelInfinispanITCase.java
rename to integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/CamelTCase.java
index 5718406..f725603 100644
--- a/integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/CamelInfinispanITCase.java
+++ b/integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/CamelTCase.java
@@ -19,5 +19,5 @@ package org.apache.camel.quarkus.component.infinispan;
 import io.quarkus.test.junit.SubstrateTest;
 
 @SubstrateTest
-public class CamelInfinispanITCase extends CamelInfinispanTest {
+public class CamelTCase extends CamelTest {
 }
diff --git a/integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/CamelInfinispanTest.java b/integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/CamelTest.java
similarity index 70%
rename from integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/CamelInfinispanTest.java
rename to integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/CamelTest.java
index 9e2fb00..ea66692 100644
--- a/integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/CamelInfinispanTest.java
+++ b/integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/CamelTest.java
@@ -16,24 +16,33 @@
  */
 package org.apache.camel.quarkus.component.infinispan;
 
-import java.net.URI;
+import javax.inject.Inject;
 
 import io.quarkus.test.common.QuarkusTestResource;
 import io.quarkus.test.junit.QuarkusTest;
 import io.restassured.RestAssured;
+import org.apache.camel.quarkus.main.CamelMain;
+import org.infinispan.client.hotrod.RemoteCacheManager;
 import org.junit.jupiter.api.Test;
 
 import static org.hamcrest.Matchers.is;
 
 @QuarkusTest
 @QuarkusTestResource(InfinispanServerTestResource.class)
-public class CamelInfinispanTest {
+public class CamelTest {
+    @Inject
+    CamelMain main;
+    @Inject
+    RemoteCacheManager cacheManager;
 
     @Test
-    public void testInfinispan() throws Exception {
-        RestAssured.with().body("Hello Infinispan").post(new URI("http://localhost:8999/put")).then();
+    public void testInfinispan() {
+        RestAssured.with()
+            .body("Hello Infinispan")
+            .post("/test/put").then();
 
-        RestAssured.when().get(new URI("http://localhost:8999/get"))
-                .then().body(is("Hello Infinispan"));
+        RestAssured.when()
+            .get("/test/get")
+            .then().body(is("Hello Infinispan"));
     }
 }
diff --git a/integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/InfinispanServerTestResource.java b/integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/InfinispanServerTestResource.java
index 8742436..e59c087 100644
--- a/integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/InfinispanServerTestResource.java
+++ b/integration-tests/infinispan/src/test/java/org/apache/camel/quarkus/component/infinispan/InfinispanServerTestResource.java
@@ -30,20 +30,38 @@ import org.infinispan.test.fwk.TestResourceTracker;
 
 public class InfinispanServerTestResource implements QuarkusTestResourceLifecycleManager {
     private HotRodServer hotRodServer;
+    private CamelTest camelTest;
 
     @Override
     public Map<String, String> start() {
         TestResourceTracker.setThreadTestName("InfinispanServer");
         EmbeddedCacheManager ecm = TestCacheManagerFactory.createCacheManager(
-                new GlobalConfigurationBuilder().nonClusteredDefault().defaultCacheName("default"),
-                new ConfigurationBuilder());
+            new GlobalConfigurationBuilder().nonClusteredDefault().defaultCacheName("default"),
+            new ConfigurationBuilder()
+        );
+
         // Client connects to a non default port
         hotRodServer = HotRodTestingUtil.startHotRodServer(ecm, 11232);
+
         return Collections.emptyMap();
     }
 
     @Override
+    public void inject(Object testInstance) {
+        if (testInstance instanceof CamelTest) {
+            this.camelTest = (CamelTest)testInstance;
+        }
+    }
+
+    @Override
     public void stop() {
+        //
+        // This is needed to properly stop the resources in the right order and
+        // avoid spurious exceptions shown in the logs.
+        //
+        if (camelTest != null && camelTest.cacheManager != null) {
+            camelTest.cacheManager.stop();
+        }
         if (hotRodServer != null) {
             hotRodServer.stop();
         }
diff --git a/integration-tests/jdbc/pom.xml b/integration-tests/jdbc/pom.xml
index 1a0d6a8..1d512de 100644
--- a/integration-tests/jdbc/pom.xml
+++ b/integration-tests/jdbc/pom.xml
@@ -32,6 +32,10 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-main</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-jdbc</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/mail/pom.xml b/integration-tests/mail/pom.xml
index edac3ad..beb0f8d 100644
--- a/integration-tests/mail/pom.xml
+++ b/integration-tests/mail/pom.xml
@@ -32,6 +32,10 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-main</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-mail</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/mail/src/main/java/org/apache/camel/quarkus/component/mail/CamelRoute.java b/integration-tests/mail/src/main/java/org/apache/camel/quarkus/component/mail/CamelRoute.java
index 714b1ac..8f1caf8 100644
--- a/integration-tests/mail/src/main/java/org/apache/camel/quarkus/component/mail/CamelRoute.java
+++ b/integration-tests/mail/src/main/java/org/apache/camel/quarkus/component/mail/CamelRoute.java
@@ -24,16 +24,15 @@ import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mail.MailComponent;
 
 public class CamelRoute extends RouteBuilder {
-
     @Override
     public void configure() {
         bindToRegistry("smtp", smtp());
 
         from("direct:mailtext")
-                .setHeader("Subject", constant("Hello World"))
-                .setHeader("To", constant("james@localhost"))
-                .setHeader("From", constant("claus@localhost"))
-                .to("smtp://localhost?consumer.initialDelay=100&consumer.delay=100");
+            .setHeader("Subject", constant("Hello World"))
+            .setHeader("To", constant("james@localhost"))
+            .setHeader("From", constant("claus@localhost"))
+            .to("smtp://localhost?initialDelay=100&delay=100");
     }
 
     @Produces
@@ -43,5 +42,4 @@ public class CamelRoute extends RouteBuilder {
         mail.getConfiguration().setSession(session);
         return mail;
     }
-
 }
diff --git a/integration-tests/mail/src/main/resources/application.properties b/integration-tests/mail/src/main/resources/application.properties
index b87f452..065058a 100644
--- a/integration-tests/mail/src/main/resources/application.properties
+++ b/integration-tests/mail/src/main/resources/application.properties
@@ -26,7 +26,6 @@ quarkus.log.file.enable = false
 quarkus.camel.disable-xml=true
 quarkus.camel.disable-jaxb=true
 quarkus.camel.dump-routes=true
-quarkus.camel.defer-init-phase=true
 
 #
 # Camel
diff --git a/integration-tests/mail/src/test/java/org/apache/camel/quarkus/component/mail/MailTest.java b/integration-tests/mail/src/test/java/org/apache/camel/quarkus/component/mail/MailTest.java
index 823e099..5faf5d9 100644
--- a/integration-tests/mail/src/test/java/org/apache/camel/quarkus/component/mail/MailTest.java
+++ b/integration-tests/mail/src/test/java/org/apache/camel/quarkus/component/mail/MailTest.java
@@ -19,27 +19,33 @@ package org.apache.camel.quarkus.component.mail;
 import io.quarkus.test.junit.QuarkusTest;
 import io.restassured.RestAssured;
 import io.restassured.http.ContentType;
-import org.apache.camel.Exchange;
 import org.junit.jupiter.api.Test;
-import org.jvnet.mock_javamail.Mailbox;
 
-import static org.hamcrest.Matchers.equalTo;
-import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.hamcrest.core.Is.is;
 
 @QuarkusTest
 public class MailTest {
-
     @Test
     public void testSendAsMail() throws Exception {
-        RestAssured.given().contentType(ContentType.TEXT).body("Hi how are you")
-                .post("/mail/mailtext");
+        RestAssured.given()
+            .contentType(ContentType.TEXT)
+            .body("Hi how are you")
+            .post("/mail/mailtext")
+            .then()
+                .statusCode(200);
 
-        assertEquals("1", RestAssured.given().get("/mock/{username}/size",
-                "james@localhost").asString());
-        assertEquals("Hi how are you", RestAssured.given().get("/mock/{username}/{id}/content",
-                "james@localhost", 0).asString());
-        assertEquals("Hello World", RestAssured.given().get("/mock/{username}/{id}/subject",
-                "james@localhost", 0).asString());
+        RestAssured.given()
+            .get("/mock/{username}/size", "james@localhost")
+            .then()
+                .body(is("1"));
+        RestAssured.given()
+            .get("/mock/{username}/{id}/content", "james@localhost", 0)
+            .then()
+                .body(is("Hi how are you"));
+        RestAssured.given()
+            .get("/mock/{username}/{id}/subject", "james@localhost", 0)
+            .then()
+                .body(is("Hello World"));
     }
 
 }
diff --git a/integration-tests/main/deployment/pom.xml b/integration-tests/main/deployment/pom.xml
new file mode 100644
index 0000000..e07be04
--- /dev/null
+++ b/integration-tests/main/deployment/pom.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <groupId>org.apache.camel.quarkus</groupId>
+        <artifactId>camel-quarkus-integration-test-main-parent</artifactId>
+        <version>0.2.1-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>camel-quarkus-integration-test-main-ext-deployment</artifactId>
+    <name>Camel Quarkus :: Integration Tests :: Main :: Extension :: Deployment</name>
+    <description>A test extension</description>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.camel.quarkus</groupId>
+                <artifactId>camel-quarkus-bom-deployment</artifactId>
+                <version>${project.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-core-deployment</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-main-deployment</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-integration-test-main-ext</artifactId>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <configuration>
+                    <annotationProcessorPaths>
+                        <path>
+                            <groupId>io.quarkus</groupId>
+                            <artifactId>quarkus-extension-processor</artifactId>
+                            <version>${quarkus.version}</version>
+                        </path>
+                    </annotationProcessorPaths>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/InitializedEvent.java b/integration-tests/main/deployment/src/main/java/org/apache/camel/quarkus/main/support/deployment/Feature.java
similarity index 69%
rename from extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/InitializedEvent.java
rename to integration-tests/main/deployment/src/main/java/org/apache/camel/quarkus/main/support/deployment/Feature.java
index 414c709..cc68cbd 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/InitializedEvent.java
+++ b/integration-tests/main/deployment/src/main/java/org/apache/camel/quarkus/main/support/deployment/Feature.java
@@ -14,8 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core.runtime;
+package org.apache.camel.quarkus.main.support.deployment;
 
-public class InitializedEvent {
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
 
+public class Feature {
+    private static final String FEATURE = "camel-main-support";
+
+    @BuildStep
+    FeatureBuildItem feature() {
+        return new FeatureBuildItem(FEATURE);
+    }
 }
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/InitializingEvent.java b/integration-tests/main/deployment/src/main/java/org/apache/camel/quarkus/main/support/deployment/SupportBuildStep.java
similarity index 61%
rename from extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/InitializingEvent.java
rename to integration-tests/main/deployment/src/main/java/org/apache/camel/quarkus/main/support/deployment/SupportBuildStep.java
index 530bc28..eecce74 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/InitializingEvent.java
+++ b/integration-tests/main/deployment/src/main/java/org/apache/camel/quarkus/main/support/deployment/SupportBuildStep.java
@@ -14,8 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core.runtime;
+package org.apache.camel.quarkus.main.support.deployment;
 
-public class InitializingEvent {
+import io.quarkus.deployment.annotations.BuildProducer;
+import io.quarkus.deployment.annotations.BuildStep;
+import org.apache.camel.quarkus.main.deployment.CamelMainListenerBuildItem;
+import org.apache.camel.quarkus.main.support.SupportListener;
 
+public class SupportBuildStep {
+    @BuildStep
+    void listener(BuildProducer<CamelMainListenerBuildItem> listener) {
+        listener.produce(new CamelMainListenerBuildItem(new SupportListener()));
+    }
 }
diff --git a/integration-tests/main/pom.xml b/integration-tests/main/pom.xml
new file mode 100644
index 0000000..81ae321
--- /dev/null
+++ b/integration-tests/main/pom.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+         http://www.apache.org/licenses/LICENSE-2.0
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <groupId>org.apache.camel.quarkus</groupId>
+        <artifactId>camel-quarkus-integration-tests</artifactId>
+        <version>0.2.1-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <packaging>pom</packaging>
+
+    <artifactId>camel-quarkus-integration-test-main-parent</artifactId>
+    <name>Camel Quarkus :: Integration Tests :: Main :: Parent</name>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.camel.quarkus</groupId>
+                <artifactId>camel-quarkus-integration-test-main-ext</artifactId>
+                <version>${project.version}</version>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <modules>
+        <module>runtime</module>
+        <module>deployment</module>
+        <module>test</module>
+    </modules>
+
+</project>
diff --git a/extensions/core/runtime/pom.xml b/integration-tests/main/runtime/pom.xml
similarity index 63%
copy from extensions/core/runtime/pom.xml
copy to integration-tests/main/runtime/pom.xml
index 97b899d..8873355 100644
--- a/extensions/core/runtime/pom.xml
+++ b/integration-tests/main/runtime/pom.xml
@@ -20,13 +20,14 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>org.apache.camel.quarkus</groupId>
-        <artifactId>camel-quarkus-core-parent</artifactId>
+        <artifactId>camel-quarkus-integration-test-main-parent</artifactId>
         <version>0.2.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>camel-quarkus-core</artifactId>
-    <name>Camel Quarkus :: Core :: Runtime</name>
+    <artifactId>camel-quarkus-integration-test-main-ext</artifactId>
+    <name>Camel Quarkus :: Integration Tests :: Main :: Extension :: Runtime</name>
+    <description>A test extension</description>
 
     <dependencyManagement>
         <dependencies>
@@ -42,47 +43,12 @@
 
     <dependencies>
         <dependency>
-            <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-arc</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-caffeine</artifactId>
-        </dependency>
-
-        <!-- camel -->
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-core-engine</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-base</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-properties</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-caffeine-lrucache</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-microprofile-config</artifactId>
-        </dependency>
-        <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-support-common</artifactId>
+            <artifactId>camel-quarkus-core</artifactId>
         </dependency>
-
         <dependency>
-            <groupId>com.oracle.substratevm</groupId>
-            <artifactId>svm</artifactId>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-main</artifactId>
         </dependency>
     </dependencies>
 
diff --git a/integration-tests/main/runtime/src/main/java/org/apache/camel/quarkus/main/support/SupportListener.java b/integration-tests/main/runtime/src/main/java/org/apache/camel/quarkus/main/support/SupportListener.java
new file mode 100644
index 0000000..15276ef
--- /dev/null
+++ b/integration-tests/main/runtime/src/main/java/org/apache/camel/quarkus/main/support/SupportListener.java
@@ -0,0 +1,56 @@
+/*
+ * 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.main.support;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.main.MainListener;
+import org.apache.camel.main.MainSupport;
+
+public class SupportListener implements MainListener {
+    @Override
+    public void configure(CamelContext context) {
+        try {
+            context.addRoutes(new RouteBuilder() {
+                @Override
+                public void configure() throws Exception {
+                    from("timer:listener")
+                        .id("listener")
+                        .to("log:listener");
+                }
+            });
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    @Override
+    public void beforeStart(MainSupport main) {
+    }
+
+    @Override
+    public void afterStart(MainSupport main) {
+    }
+
+    @Override
+    public void beforeStop(MainSupport main) {
+    }
+
+    @Override
+    public void afterStop(MainSupport main) {
+    }
+}
diff --git a/integration-tests/core-cdi/pom.xml b/integration-tests/main/test/pom.xml
similarity index 85%
rename from integration-tests/core-cdi/pom.xml
rename to integration-tests/main/test/pom.xml
index 25e5f66..32df180 100644
--- a/integration-tests/core-cdi/pom.xml
+++ b/integration-tests/main/test/pom.xml
@@ -20,35 +20,40 @@
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <parent>
         <groupId>org.apache.camel.quarkus</groupId>
-        <artifactId>camel-quarkus-integration-tests</artifactId>
+        <artifactId>camel-quarkus-integration-test-main-parent</artifactId>
         <version>0.2.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>camel-quarkus-integration-test-core-cdi</artifactId>
-    <name>Camel Quarkus :: Integration Tests :: Core CDI</name>
+    <artifactId>camel-quarkus-integration-test-main</artifactId>
+    <name>Camel Quarkus :: Integration Tests :: Main</name>
     <description>The camel integration tests</description>
 
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core</artifactId>
+            <artifactId>camel-quarkus-main</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-direct</artifactId>
+            <artifactId>camel-quarkus-log</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-xml-common</artifactId>
+            <artifactId>camel-quarkus-timer</artifactId>
         </dependency>
         <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-integration-test-main-ext</artifactId>
+        </dependency>
+
+        <dependency>
             <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-resteasy</artifactId>
+            <artifactId>quarkus-jsonb</artifactId>
         </dependency>
         <dependency>
             <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-vertx</artifactId>
+            <artifactId>quarkus-resteasy-jsonb</artifactId>
         </dependency>
 
         <!-- test dependencies -->
@@ -62,6 +67,12 @@
             <artifactId>rest-assured</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.assertj</groupId>
+            <artifactId>assertj-core</artifactId>
+            <scope>test</scope>
+        </dependency>
+
     </dependencies>
 
     <build>
diff --git a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/StartedEvent.java b/integration-tests/main/test/src/main/java/org/apache/camel/quarkus/main/CamelRoute.java
similarity index 71%
rename from extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/StartedEvent.java
rename to integration-tests/main/test/src/main/java/org/apache/camel/quarkus/main/CamelRoute.java
index 480057a..e43f8e5 100644
--- a/extensions/core/runtime/src/main/java/org/apache/camel/quarkus/core/runtime/StartedEvent.java
+++ b/integration-tests/main/test/src/main/java/org/apache/camel/quarkus/main/CamelRoute.java
@@ -14,8 +14,17 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core.runtime;
+package org.apache.camel.quarkus.main;
 
-public class StartedEvent {
+import org.apache.camel.builder.RouteBuilder;
 
+public class CamelRoute extends RouteBuilder {
+
+    @Override
+    public void configure() {
+        from("timer:keep-alive")
+            .id("keep-alive")
+            .setBody().constant("I'm alive !")
+            .to("log:keep-alive");
+    }
 }
diff --git a/integration-tests/core/test/src/main/java/org/apache/camel/quarkus/core/CamelServlet.java b/integration-tests/main/test/src/main/java/org/apache/camel/quarkus/main/CamelServlet.java
similarity index 66%
copy from integration-tests/core/test/src/main/java/org/apache/camel/quarkus/core/CamelServlet.java
copy to integration-tests/main/test/src/main/java/org/apache/camel/quarkus/main/CamelServlet.java
index a88916e..4054f2f 100644
--- a/integration-tests/core/test/src/main/java/org/apache/camel/quarkus/core/CamelServlet.java
+++ b/integration-tests/main/test/src/main/java/org/apache/camel/quarkus/main/CamelServlet.java
@@ -14,14 +14,13 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core;
+package org.apache.camel.quarkus.main;
 
-import java.util.List;
 import java.util.Set;
-import java.util.stream.Collectors;
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
 import javax.json.Json;
+import javax.json.JsonArrayBuilder;
 import javax.json.JsonObject;
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
@@ -30,39 +29,36 @@ import javax.ws.rs.PathParam;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.ExtendedCamelContext;
-import org.apache.camel.Route;
 import org.apache.camel.component.log.LogComponent;
 import org.apache.camel.component.timer.TimerComponent;
 import org.apache.camel.quarkus.core.runtime.CamelConfig;
-import org.apache.camel.quarkus.core.runtime.CamelRuntime;
+import org.apache.camel.spi.Registry;
 import org.apache.camel.support.processor.DefaultExchangeFormatter;
 
 @Path("/test")
 @ApplicationScoped
 public class CamelServlet {
     @Inject
-    CamelRuntime runtime;
-
-    @Path("/routes")
-    @GET
-    @Produces(MediaType.TEXT_PLAIN)
-    public List<String> getRoutes() {
-        return runtime.getContext().getRoutes().stream().map(Route::getId).collect(Collectors.toList());
-    }
+    CamelMain main;
+    @Inject
+    Registry registry;
+    @Inject
+    CamelContext context;
 
     @Path("/property/{name}")
     @GET
     @Produces(MediaType.TEXT_PLAIN)
     public String getProperty(@PathParam("name") String name) throws Exception {
-        return runtime.getContext().resolvePropertyPlaceholders("{{" + name + "}}");
+        return context.resolvePropertyPlaceholders("{{" + name + "}}");
     }
 
     @Path("/timer/property-binding")
     @GET
     @Produces(MediaType.TEXT_PLAIN)
     public boolean timerResolvePropertyPlaceholders() throws Exception {
-        return runtime.getContext().getComponent("timer", TimerComponent.class).isBasicPropertyBinding();
+        return context.getComponent("timer", TimerComponent.class).isBasicPropertyBinding();
     }
 
 
@@ -70,7 +66,7 @@ public class CamelServlet {
     @GET
     @Produces(MediaType.APPLICATION_JSON)
     public JsonObject exchangeFormatterConfig() {
-        LogComponent component = runtime.getRegistry().lookupByNameAndType("log", LogComponent.class);
+        LogComponent component = registry.lookupByNameAndType("log", LogComponent.class);
         DefaultExchangeFormatter def = (DefaultExchangeFormatter)component.getExchangeFormatter();
 
         JsonObject result = Json.createObjectBuilder()
@@ -96,7 +92,7 @@ public class CamelServlet {
     }
 
     private <T> T lookupSingleInstanceFromRegistry(Class<T> type) {
-        final Set<T> answer = runtime.getContext().getRegistry().findByType(type);
+        final Set<T> answer = context.getRegistry().findByType(type);
 
         if (answer.size() == 1) {
             return answer.iterator().next();
@@ -109,14 +105,35 @@ public class CamelServlet {
     @GET
     @Produces(MediaType.TEXT_PLAIN)
     public String getCamelContextName() {
-        return runtime.getContext().getName();
+        return context.getName();
     }
 
     @Path("/context/name")
     @POST
     @Produces(MediaType.TEXT_PLAIN)
     public String setCamelContextName(String name) {
-        runtime.getContext().adapt(ExtendedCamelContext.class).setName(name);
-        return runtime.getContext().getName();
+        context.adapt(ExtendedCamelContext.class).setName(name);
+        return context.getName();
+    }
+
+    @Path("/main/describe")
+    @GET
+    @Produces(MediaType.APPLICATION_JSON)
+    public JsonObject describeMain() {
+        JsonArrayBuilder listeners = Json.createArrayBuilder();
+        main.getMainListeners().forEach(listener -> listeners.add(listener.getClass().getName()));
+
+        JsonArrayBuilder routeBuilders = Json.createArrayBuilder();
+        main.getRouteBuilders().forEach(builder -> routeBuilders.add(builder.getClass().getName()));
+
+        JsonArrayBuilder routes = Json.createArrayBuilder();
+        main.getCamelContext().getRoutes().forEach(route -> routes.add(route.getId()));
+
+        return Json.createObjectBuilder()
+            .add("listeners", listeners)
+            .add("routeBuilders", routeBuilders)
+            .add("routes", routes)
+            .add("autoConfigurationLogSummary", main.getMainConfigurationProperties().isAutoConfigurationLogSummary())
+            .build();
     }
 }
diff --git a/integration-tests/core/test/src/main/resources/application.properties b/integration-tests/main/test/src/main/resources/application.properties
similarity index 95%
copy from integration-tests/core/test/src/main/resources/application.properties
copy to integration-tests/main/test/src/main/resources/application.properties
index b441636..bd8ffb4 100644
--- a/integration-tests/core/test/src/main/resources/application.properties
+++ b/integration-tests/main/test/src/main/resources/application.properties
@@ -31,10 +31,12 @@ quarkus.camel.dump-routes=true
 #
 camel.context.name=quarkus-camel-example
 
+#
 # Timer
+#
 camel.component.timer.basic-property-binding = true
 
 #
-# Integration
+# Main
 #
-integration.folder={{sys:folder:./target/orders}}
\ No newline at end of file
+camel.main.auto-configuration-log-summary = false
\ No newline at end of file
diff --git a/integration-tests/core-cdi/src/test/java/org/apache/camel/quarkus/component/core/cdi/CamelITCase.java b/integration-tests/main/test/src/test/java/org/apache/camel/quarkus/main/CamelITCase.java
similarity index 94%
rename from integration-tests/core-cdi/src/test/java/org/apache/camel/quarkus/component/core/cdi/CamelITCase.java
rename to integration-tests/main/test/src/test/java/org/apache/camel/quarkus/main/CamelITCase.java
index 82c4823..7658725 100644
--- a/integration-tests/core-cdi/src/test/java/org/apache/camel/quarkus/component/core/cdi/CamelITCase.java
+++ b/integration-tests/main/test/src/test/java/org/apache/camel/quarkus/main/CamelITCase.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.component.core.cdi;
+package org.apache.camel.quarkus.main;
 
 import io.quarkus.test.junit.SubstrateTest;
 
diff --git a/integration-tests/core/test/src/test/java/org/apache/camel/quarkus/core/CamelTest.java b/integration-tests/main/test/src/test/java/org/apache/camel/quarkus/main/CamelTest.java
similarity index 67%
copy from integration-tests/core/test/src/test/java/org/apache/camel/quarkus/core/CamelTest.java
copy to integration-tests/main/test/src/test/java/org/apache/camel/quarkus/main/CamelTest.java
index 0d26aa5..9d153c2 100644
--- a/integration-tests/core/test/src/test/java/org/apache/camel/quarkus/core/CamelTest.java
+++ b/integration-tests/main/test/src/test/java/org/apache/camel/quarkus/main/CamelTest.java
@@ -14,30 +14,26 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.core;
+package org.apache.camel.quarkus.main;
 
 import java.net.HttpURLConnection;
+import javax.ws.rs.core.MediaType;
 
 import io.quarkus.test.junit.QuarkusTest;
 import io.restassured.RestAssured;
 import io.restassured.http.ContentType;
+import io.restassured.path.json.JsonPath;
 import io.restassured.response.Response;
+import org.apache.camel.quarkus.main.support.SupportListener;
 import org.junit.jupiter.api.Test;
 
-import static org.hamcrest.Matchers.containsString;
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.hamcrest.Matchers.is;
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotEquals;
-import static org.junit.jupiter.api.Assertions.assertTrue;
 
 @QuarkusTest
 public class CamelTest {
-
-    @Test
-    public void testRoutes() {
-        RestAssured.when().get("/test/routes").then().body(containsString("timer"));
-    }
-
     @Test
     public void testProperties() {
         RestAssured.when().get("/test/property/camel.context.name").then().body(is("quarkus-camel-example"));
@@ -50,21 +46,6 @@ public class CamelTest {
     }
 
     @Test
-    public void testRegistry() {
-        RestAssured.when().get("/test/registry/produces-config-build").then().body(is("true"));
-        RestAssured.when().get("/test/registry/produces-config-runtime").then().body(is("true"));
-    }
-
-    @Test
-    public void testRegistryBuildItem() {
-        Response response = RestAssured.get("/test/registry/log/exchange-formatter").andReturn();
-
-        assertEquals(HttpURLConnection.HTTP_OK, response.getStatusCode());
-        assertTrue(response.jsonPath().getBoolean("show-all"));
-        assertTrue(response.jsonPath().getBoolean("multi-line"));
-    }
-
-    @Test
     public void testSetCamelContextName() {
         Response response = RestAssured.get("/test/context/name").andReturn();
 
@@ -76,4 +57,27 @@ public class CamelTest {
             .post("/test/context/name")
             .then().body(is("my-ctx-name"));
     }
+
+    @Test
+    public void testMainInstance() {
+        JsonPath p = RestAssured.given()
+            .accept(MediaType.APPLICATION_JSON)
+            .get("/test/main/describe")
+            .then()
+                .statusCode(200)
+            .extract()
+                .body()
+                .jsonPath();
+
+        assertThat(p.getList("listeners", String.class))
+            .containsOnly(CamelMainEventDispatcher.class.getName(), SupportListener.class.getName());
+        assertThat(p.getList("routeBuilders", String.class))
+            .containsOnly(CamelRoute.class.getName());
+        assertThat(p.getList("routes", String.class))
+            .hasSize(2)
+            .containsOnly("keep-alive", "listener");
+
+        assertThat(p.getBoolean("autoConfigurationLogSummary")).isFalse();
+
+    }
 }
diff --git a/integration-tests/microprofile-metrics/pom.xml b/integration-tests/microprofile-metrics/pom.xml
index a2e3cf3..8469d0f 100644
--- a/integration-tests/microprofile-metrics/pom.xml
+++ b/integration-tests/microprofile-metrics/pom.xml
@@ -32,6 +32,10 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-main</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-microprofile-metrics</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/netty-http/pom.xml b/integration-tests/netty-http/pom.xml
index 53fffd3..71efab8 100644
--- a/integration-tests/netty-http/pom.xml
+++ b/integration-tests/netty-http/pom.xml
@@ -32,7 +32,7 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-core</artifactId>
+            <artifactId>camel-quarkus-main</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
diff --git a/integration-tests/netty-http/src/main/resources/application.properties b/integration-tests/netty-http/src/main/resources/application.properties
index 603d5f3..a8669e2 100644
--- a/integration-tests/netty-http/src/main/resources/application.properties
+++ b/integration-tests/netty-http/src/main/resources/application.properties
@@ -25,15 +25,8 @@ quarkus.log.file.enable = false
 quarkus.camel.disable-xml=true
 quarkus.camel.disable-jaxb=true        
 quarkus.camel.dump-routes=true
+
 #
 # Camel
 #
 camel.context.name = quarkus-camel-example
-
-#
-# Camel :: AWS
-#
-camel.component.aws-sqs.access-key={{env:SQS_ACCESS_KEY}}
-camel.component.aws-sqs.secret-key={{env:SQS_SECRET_KEY}}
-camel.component.aws-sqs.region={{env:SQS_REGION}}
-
diff --git a/integration-tests/paho/pom.xml b/integration-tests/paho/pom.xml
index 3f9f29b..0bc2301 100644
--- a/integration-tests/paho/pom.xml
+++ b/integration-tests/paho/pom.xml
@@ -32,6 +32,10 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-main</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-paho</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/platform-http/pom.xml b/integration-tests/platform-http/pom.xml
index fb9e5ee..e4c6903 100644
--- a/integration-tests/platform-http/pom.xml
+++ b/integration-tests/platform-http/pom.xml
@@ -34,6 +34,10 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-main</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-platform-http</artifactId>
         </dependency>
 
diff --git a/integration-tests/platform-http/src/main/resources/application.properties b/integration-tests/platform-http/src/main/resources/application.properties
index 460b930..b3214ac 100644
--- a/integration-tests/platform-http/src/main/resources/application.properties
+++ b/integration-tests/platform-http/src/main/resources/application.properties
@@ -26,7 +26,3 @@ quarkus.log.category."org.apache.camel.quarkus.component.platform.http".level =
 #
 quarkus.camel.disable-xml=true
 quarkus.camel.disable-jaxb=true
-
-# A workaround for https://github.com/quarkusio/quarkus/issues/4047
-# can be removed after an upgrade to Quarkus 0.23.0
-quarkus.vertx-http.port = 8081
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index 6a2e76c..5bd6c06 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -80,7 +80,7 @@
         <!-- build those first -->
         <module>core</module>
         <module>core-impl</module>
-        <module>core-cdi</module>
+        <module>main</module>
 
         <module>netty-http</module>
         <module>aws</module>
diff --git a/integration-tests/salesforce/pom.xml b/integration-tests/salesforce/pom.xml
index c7654b2..4c65ce0 100644
--- a/integration-tests/salesforce/pom.xml
+++ b/integration-tests/salesforce/pom.xml
@@ -32,6 +32,10 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-main</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-salesforce</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/salesforce/src/main/java/org/apache/camel/quarkus/component/salesforce/CamelServlet.java b/integration-tests/salesforce/src/main/java/org/apache/camel/quarkus/component/salesforce/CamelServlet.java
index f54361e..94fcf05 100644
--- a/integration-tests/salesforce/src/main/java/org/apache/camel/quarkus/component/salesforce/CamelServlet.java
+++ b/integration-tests/salesforce/src/main/java/org/apache/camel/quarkus/component/salesforce/CamelServlet.java
@@ -26,19 +26,17 @@ import javax.ws.rs.core.MediaType;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.ProducerTemplate;
-import org.apache.camel.quarkus.core.runtime.CamelRuntime;
 
 @Path("/test")
 @ApplicationScoped
 public class CamelServlet {
     @Inject
-    CamelRuntime runtime;
+    CamelContext context;
 
     @Path("/case/{id}")
     @GET
     @Produces(MediaType.APPLICATION_JSON)
     public Object getCase(@PathParam("id") String id) {
-        CamelContext context = runtime.getContext();
         ProducerTemplate template = context.createProducerTemplate();
 
         return template.requestBody("direct:case", id);
diff --git a/integration-tests/servlet/pom.xml b/integration-tests/servlet/pom.xml
index a139099..e3c1c5f 100644
--- a/integration-tests/servlet/pom.xml
+++ b/integration-tests/servlet/pom.xml
@@ -45,6 +45,10 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-main</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-servlet</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/twitter/pom.xml b/integration-tests/twitter/pom.xml
index 7ac858b..74c94dc 100644
--- a/integration-tests/twitter/pom.xml
+++ b/integration-tests/twitter/pom.xml
@@ -32,6 +32,10 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-main</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-twitter</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/zipfile/pom.xml b/integration-tests/zipfile/pom.xml
index ad92e59..900b153 100644
--- a/integration-tests/zipfile/pom.xml
+++ b/integration-tests/zipfile/pom.xml
@@ -32,6 +32,10 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-main</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-zipfile</artifactId>
         </dependency>
         <dependency>
diff --git a/pom.xml b/pom.xml
index c429792..15d7354 100644
--- a/pom.xml
+++ b/pom.xml
@@ -40,7 +40,7 @@
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
 
-        <camel.version>3.0.0-RC1</camel.version>
+        <camel.version>3.0.0-SNAPSHOT</camel.version>
         <quarkus.version>0.23.2</quarkus.version>
         <jetty.version>9.4.18.v20190429</jetty.version>
         <xstream.version>1.4.11</xstream.version>
diff --git a/poms/bom-deployment/pom.xml b/poms/bom-deployment/pom.xml
index c0c1090..1a0cba5 100644
--- a/poms/bom-deployment/pom.xml
+++ b/poms/bom-deployment/pom.xml
@@ -152,6 +152,11 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.camel.quarkus</groupId>
+                <artifactId>camel-quarkus-main-deployment</artifactId>
+                <version>${camel-quarkus.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.camel.quarkus</groupId>
                 <artifactId>camel-quarkus-microprofile-metrics-deployment</artifactId>
                 <version>${project.version}</version>
             </dependency>
diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml
index a45b653..17c6434 100644
--- a/poms/bom/pom.xml
+++ b/poms/bom/pom.xml
@@ -157,6 +157,11 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.camel</groupId>
+                <artifactId>camel-main</artifactId>
+                <version>${camel.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.camel</groupId>
                 <artifactId>camel-microprofile-config</artifactId>
                 <version>${camel.version}</version>
             </dependency>
@@ -178,11 +183,6 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.camel</groupId>
-                <artifactId>camel-properties</artifactId>
-                <version>${camel.version}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.camel</groupId>
                 <artifactId>camel-paho</artifactId>
                 <version>${camel.version}</version>
             </dependency>
@@ -329,6 +329,11 @@
             </dependency>
             <dependency>
                 <groupId>org.apache.camel.quarkus</groupId>
+                <artifactId>camel-quarkus-main</artifactId>
+                <version>${camel-quarkus.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.apache.camel.quarkus</groupId>
                 <artifactId>camel-quarkus-netty-http</artifactId>
                 <version>${camel-quarkus.version}</version>
             </dependency>