[
https://issues.apache.org/jira/browse/CAMEL-3425?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971221#action_12971221
]
Claus Ibsen commented on CAMEL-3425:
------------------------------------
If you compare this to a spring-dm test from tests/camel-itest-osgi. For
example org.apache.camel.itest.osgi.core.direct.DirectTest
{code}
[RMI TCP Connection(1)-10.0.1.2] INFO
org.apache.camel.itest.osgi.core.direct.DirectTest -
********************************************************************************
[RMI TCP Connection(1)-10.0.1.2] INFO
org.apache.camel.itest.osgi.core.direct.DirectTest - Testing:
(org.apache.camel.itest.osgi.core.direct.DirectTest)
[RMI TCP Connection(1)-10.0.1.2] INFO
org.apache.camel.itest.osgi.core.direct.DirectTest -
********************************************************************************
[RMI TCP Connection(1)-10.0.1.2] INFO
org.apache.camel.itest.osgi.OSGiIntegrationTestSupport - Get the bundleContext
is org.eclipse.osgi.framework.internal.core.bundlecontexti...@20d9896e
[RMI TCP Connection(1)-10.0.1.2] INFO
org.apache.camel.itest.osgi.OSGiIntegrationTestSupport - Application installed
as bundle id: 49
[RMI TCP Connection(1)-10.0.1.2] INFO org.apache.camel.impl.DefaultCamelContext
- Apache Camel 2.6-SNAPSHOT (CamelContext: 49-camel-2) is starting
[RMI TCP Connection(1)-10.0.1.2] INFO org.apache.camel.impl.DefaultCamelContext
- Debugger: DefaultDebugger is enabled on CamelContext: 49-camel-2
[RMI TCP Connection(1)-10.0.1.2] INFO org.apache.camel.impl.DefaultCamelContext
- JMX is disabled. Using DefaultManagementStrategy.
[RMI TCP Connection(1)-10.0.1.2] INFO org.apache.camel.impl.osgi.Activator -
Found 13 @Converter classes to load
[RMI TCP Connection(1)-10.0.1.2] INFO org.apache.camel.impl.DefaultCamelContext
- Route: route1 started and consuming from: Endpoint[direct://start]
[RMI TCP Connection(1)-10.0.1.2] INFO org.apache.camel.impl.DefaultCamelContext
- Total 1 routes, of which 1 is started.
[RMI TCP Connection(1)-10.0.1.2] INFO org.apache.camel.impl.DefaultCamelContext
- Apache Camel 2.6-SNAPSHOT (CamelContext: 49-camel-2) started in 0.175 seconds
[RMI TCP Connection(1)-10.0.1.2] INFO
org.apache.camel.component.mock.MockEndpoint - Asserting:
Endpoint[mock://result] is satisfied
[RMI TCP Connection(1)-10.0.1.2] INFO
org.apache.camel.itest.osgi.core.direct.DirectTest - Testing done:
org.apache.camel.itest.osgi.core.direct.directt...@442f1e75
[RMI TCP Connection(1)-10.0.1.2] INFO org.apache.camel.impl.DefaultCamelContext
- Apache Camel 2.6-SNAPSHOT (CamelContext:49-camel-2) is shutting down
[RMI TCP Connection(1)-10.0.1.2] INFO
org.apache.camel.impl.DefaultShutdownStrategy - Starting to graceful shutdown 1
routes (timeout 10 seconds)
[Camel (49-camel-2) thread #0 - ShutdownTask] INFO
org.apache.camel.impl.DefaultShutdownStrategy - Route: route1 suspension
deferred.
[Camel (49-camel-2) thread #0 - ShutdownTask] INFO
org.apache.camel.impl.DefaultShutdownStrategy - Route: route1 preparing to
shutdown complete.
[Camel (49-camel-2) thread #0 - ShutdownTask] INFO
org.apache.camel.impl.DefaultShutdownStrategy - Route: route1 shutdown complete.
[RMI TCP Connection(1)-10.0.1.2] INFO
org.apache.camel.impl.DefaultShutdownStrategy - Graceful shutdown of 1 routes
completed in 0 seconds
[RMI TCP Connection(1)-10.0.1.2] INFO
org.apache.camel.impl.DefaultInflightRepository - Shutting down with no
inflight exchanges.
[RMI TCP Connection(1)-10.0.1.2] INFO org.apache.camel.impl.DefaultCamelContext
- Uptime: 0.204 seconds
[RMI TCP Connection(1)-10.0.1.2] INFO org.apache.camel.impl.DefaultCamelContext
- Apache Camel 2.6-SNAPSHOT (CamelContext: 49-camel-2) is shutdown in 0.006
seconds
{code}
As you can see from the log above, CamelContext is only started *once*, and it
has been given a name using its bundle id. The end user Camel application was
given bundle id 49, which is included in the CamelContext name.
> CamelContext is started twice when using camel-blueprint
> --------------------------------------------------------
>
> Key: CAMEL-3425
> URL: https://issues.apache.org/jira/browse/CAMEL-3425
> Project: Camel
> Issue Type: Bug
> Components: camel-blueprint
> Affects Versions: 2.6.0
> Reporter: Claus Ibsen
> Assignee: Guillaume Nodet
> Priority: Critical
> Fix For: 2.6.0
>
>
> For example if you run the {{testRouteWithAllComponents}} test in
> {{CamelBlueprintTest}} in tests/camel-itest-osgi you will see _a lot_ of
> logging. But notice
> {code}
> [RMI TCP Connection(1)-10.0.1.2] INFO
> org.apache.camel.impl.DefaultCamelContext - Apache Camel 2.6-SNAPSHOT
> (CamelContext: 67-camel-2) is starting
> [RMI TCP Connection(1)-10.0.1.2] INFO
> org.apache.camel.impl.DefaultCamelContext - Apache Camel 2.6-SNAPSHOT
> (CamelContext: 67-camel-2) started in 0.144 seconds
> {code}
> Then blueprint does something
> {code}
> [Blueprint Extender: 3] INFO org.apache.camel.impl.DefaultCamelContext -
> Apache Camel 2.6-SNAPSHOT (CamelContext: 4-camel-5) is starting
> [Blueprint Extender: 3] INFO org.apache.camel.impl.DefaultCamelContext -
> Apache Camel 2.6-SNAPSHOT (CamelContext: 4-camel-5) started in 0.067 seconds
> {code}
> And likewise both CamelContext's is shutdown when the test completes. There
> are logging events for that as well.
> Pay attention to the name of the 1st CamelContext {{67-camel-2}}. This is the
> *correct* name as its based on the bundle id, our end user Camel application
> is given. This ensures that the CamelContext from his application has a name
> which is unique and refers to the bundle id as well.
> Now if you look at the 2nd CamelContext being started its given another name
> {{4-camel-5}}. That id is most likely using a shared bundle id with a low
> number. For example camel-blueprint or camel-core bundle, or something like
> that.
> In essence camel-blueprint should only create *one* CamelContext and it
> should use the {{67-camel-2}} as the name of the CamelContext (eg. include
> the bundle id of the end user application).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.