[
https://issues.apache.org/activemq/browse/CAMEL-3031?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61094#action_61094
]
Claus Ibsen commented on CAMEL-3031:
------------------------------------
When you define a <camelContext/> in a XML file, you have 2 choices
a) the id can be explicit given
b) no id given
In the former case Camel will use this id as the bean id in Spring
ApplicationContext and as well for JMX.
In the latter Camel will auto assign an unique id to be used in Spring
ApplicationContext and as well for JMX.
There are 2 problems with the current code
1)
When registering a CamelContext in JMX, Camel would ignore if an existing
CamelContext with the same id was already registered. This means that you would
end up with 2 different CamelContext's merged into the same. This means you
cannot manage the 2nd CamelContext, for example to stop it etc as it would not
be enlisted. Also when the 1st is unregistered, you would leave mbeans
_hanging_ in there for the 2nd which doensn't have a CamelContext etc. Also
there are problems with clashes of endpoint uris, error handlers, tracers etc.
Bottom line we end up with mixed data.
2)
In OSGi the auto assigned unique name is *not* unique because OSGi causes the
atomic counter to be multiple instances so you end up with Camel ids' all being
{{camel-1}}. This works in non OSGi environments such as WARs etc.
All these problems can of course be resolved by explicit assigning an unique id
for you <camelContext>'s.
We will also try to enhance the auto assigned unique name in OSGi to include
bundle id etc. so it brings more value for you. So if you bundle has given id
147, then the auto assigned id should be {{camel-147}} etc.
> Auto assigned CamelContext id should be unique in the JVM
> ---------------------------------------------------------
>
> Key: CAMEL-3031
> URL: https://issues.apache.org/activemq/browse/CAMEL-3031
> Project: Apache Camel
> Issue Type: Bug
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Fix For: 2.5.0
>
>
> See nabble
> http://camel.465427.n5.nabble.com/multiple-camel-contexts-as-viewed-from-JMX-tp2265902p2265902.html
> Route ids are being unique, so we should be able to do that for CamelContext
> id as well. And we should reject starting an application if an existing
> CamelContext exists with the same id. This applies to JMX.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.