Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-9336

camel-cdi - Should add routes to CamelContext before its started

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.17.0
    • camel-cdi
    • None
    • Unknown

    Description

      The order of when RouteBuilder is added to CdiCamelContext is after it has been started.

      You can see this from running

      mvn camel:run

      in the examples/camel-example-cdi

      Then it says 0 of 0 routes started.

      2015-11-18 17:57:20,045 [weld-worker-3  ] WARN  Validator                      - WELD-001473: javax.enterprise.inject.spi.Bean implementation org.apache.camel.cdi.internal.CamelContextBean@73690a3e declared a normal scope but does not implement javax.enterprise.inject.spi.PassivationCapable. It won't be possible to inject this bean into a bean with a passivating scope (@SessionScoped, @ConversationScoped). This can be fixed by assigning the Bean implementation a unique id by implementing the PassivationCapable interface.
      2015-11-18 17:57:20,394 [cdi.Main.main()] INFO  CdiCamelContext                - Apache Camel 2.17-SNAPSHOT (CamelContext: camel-1) is starting
      2015-11-18 17:57:20,395 [cdi.Main.main()] INFO  ManagedManagementStrategy      - JMX is enabled
      2015-11-18 17:57:20,573 [cdi.Main.main()] INFO  DefaultTypeConverter           - Loaded 182 type converters
      2015-11-18 17:57:20,613 [cdi.Main.main()] INFO  DefaultRuntimeEndpointRegistry - Runtime endpoint registry is in extended mode gathering usage statistics of all incoming and outgoing endpoints (cache limit: 1000)
      2015-11-18 17:57:20,624 [cdi.Main.main()] INFO  CdiCamelContext                - AllowUseOriginalMessage is enabled. If access to the original message is not needed, then its recommended to turn this option off as it may improve performance.
      2015-11-18 17:57:20,624 [cdi.Main.main()] INFO  CdiCamelContext                - StreamCaching is not in use. If using streams then its recommended to enable stream caching. See more details at http://camel.apache.org/stream-caching.html
      2015-11-18 17:57:20,624 [cdi.Main.main()] INFO  CdiCamelContext                - Total 0 routes, of which 0 is started.
      2015-11-18 17:57:20,626 [cdi.Main.main()] INFO  CdiCamelContext                - Apache Camel 2.17-SNAPSHOT (CamelContext: camel-1) started in 0.231 seconds
      2015-11-18 17:57:20,805 [cdi.Main.main()] INFO  CdiCamelContext                - Route: route1 started and consuming from: Endpoint[timer://foo?period=5000]
      2015-11-18 17:57:20,872 [cdi.Main.main()] INFO  Bootstrap                      - WELD-ENV-002003: Weld SE container STATIC_INSTANCE initialized
      2015-11-18 17:57:21,841 [0 - timer://foo] INFO  output                         - Exchange[ExchangePattern: InOnly, BodyType: String, Body: Saying Hello World 1 times]
      2015-11-18 17:57:26,808 [0 - timer://foo] INFO  output                         - Exchange[ExchangePattern: InOnly, BodyType: String, Body: Saying Hello World 2 times]
      

      It should say .. 1 of 1 routes started.

      Attachments

        Issue Links

          Activity

            People

              antonin.stefanutti Antonin Stefanutti
              davsclaus Claus Ibsen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: