You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/12/06 08:35:21 UTC

[camel] branch camel-3.0.x updated: CAMEL-14265: camel-cdi - Standalone CDI with Camel Main discovers routes twice

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

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


The following commit(s) were added to refs/heads/camel-3.0.x by this push:
     new ce6baf2  CAMEL-14265: camel-cdi - Standalone CDI with Camel Main discovers routes twice
ce6baf2 is described below

commit ce6baf2b178561957b849f51b108b0a3daa07f6f
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Dec 6 09:34:31 2019 +0100

    CAMEL-14265: camel-cdi - Standalone CDI with Camel Main discovers routes twice
---
 components/camel-cdi/src/main/java/org/apache/camel/cdi/Main.java | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/components/camel-cdi/src/main/java/org/apache/camel/cdi/Main.java b/components/camel-cdi/src/main/java/org/apache/camel/cdi/Main.java
index 25ed9e7..20210e9 100644
--- a/components/camel-cdi/src/main/java/org/apache/camel/cdi/Main.java
+++ b/components/camel-cdi/src/main/java/org/apache/camel/cdi/Main.java
@@ -104,6 +104,11 @@ public class Main extends MainCommandLineSupport {
         warnIfNoCamelFound();
     }
 
+    @Override
+    protected void initCamelContext() throws Exception {
+        // camel-cdi has already initialized and start CamelContext so we should not do this again
+    }
+
     private void warnIfNoCamelFound() {
         BeanManager manager = cdiContainer.getBeanManager();
         Set<Bean<?>> contexts = manager.getBeans(CamelContext.class, ANY);