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

SpringCamelContext - Should react to ContextStoppedEvent and invoke stop on CamelContext

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0, 2.1.0, 2.2.0
    • 1.6.3, 2.3.0
    • camel-spring
    • None

    Description

      I wonder why we haven't see this before.

      Without patch

      2010-03-20 14:41:50,325 [main           ] INFO  CamelNamespaceHandler          - camel-osgi.jar/camel-spring-osgi.jar not detected in classpath
      2010-03-20 14:41:51,185 [main           ] INFO  DefaultCamelContext            - Apache Camel  (CamelContext: camel) is starting
      2010-03-20 14:41:51,185 [main           ] INFO  DefaultCamelContext            - JMX enabled. Using ManagedManagementStrategy.
      2010-03-20 14:41:52,696 [main           ] INFO  DefaultCamelContext            - Started 1 routes
      2010-03-20 14:41:52,696 [main           ] INFO  DefaultCamelContext            - Apache Camel  (CamelContext: camel) started
      2010-03-20 14:41:52,723 [main           ] INFO  MockEndpoint                   - Asserting: Endpoint[mock://aggregated] is satisfied
      2010-03-20 14:41:52,791 [ 0 - Aggregator] INFO  foo                            - Exchange[BodyType:String, Body:A+B+C]
      

      With patch

      2010-03-20 14:41:16,278 [main           ] INFO  CamelNamespaceHandler          - camel-osgi.jar/camel-spring-osgi.jar not detected in classpath
      2010-03-20 14:41:17,141 [main           ] INFO  DefaultCamelContext            - Apache Camel  (CamelContext: camel) is starting
      2010-03-20 14:41:17,141 [main           ] INFO  DefaultCamelContext            - JMX enabled. Using ManagedManagementStrategy.
      2010-03-20 14:41:18,619 [main           ] INFO  DefaultCamelContext            - Started 1 routes
      2010-03-20 14:41:18,620 [main           ] INFO  DefaultCamelContext            - Apache Camel  (CamelContext: camel) started
      2010-03-20 14:41:18,646 [main           ] INFO  MockEndpoint                   - Asserting: Endpoint[mock://aggregated] is satisfied
      2010-03-20 14:41:18,711 [ 0 - Aggregator] INFO  foo                            - Exchange[BodyType:String, Body:A+B+C]
      2010-03-20 14:41:18,718 [main           ] INFO  DefaultCamelContext            - Apache Camel  (CamelContext:camel) is shutting down
      2010-03-20 14:41:18,719 [main           ] INFO  DefaultShutdownStrategy        - Starting to graceful shutdown 1 routes (timeout 10 seconds)
      2010-03-20 14:41:18,725 [ - ShutdownTask] INFO  DefaultShutdownStrategy        - Route: route1 shutdown complete.
      2010-03-20 14:41:18,725 [main           ] INFO  DefaultShutdownStrategy        - Graceful shutdown of 1 routes completed in 0 seconds
      2010-03-20 14:41:18,726 [main           ] INFO  DefaultInflightRepository      - Shutting down with no inflight exchanges.
      2010-03-20 14:41:18,730 [main           ] INFO  DefaultCamelContext            - Apache Camel  (CamelContext: camel) is shutdown
      

      This is a problem when using org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext to create Spring XML based unit tests which can reuse unit tests from camel-core.

      OSGi and other environments properly shutdown Camel.

      Attachments

        1. CAMEL-2564.txt
          2 kB
          Claus Ibsen

        Activity

          People

            njiang Willem Jiang
            davsclaus Claus Ibsen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: