[ 
https://issues.apache.org/activemq/browse/CAMEL-3031?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61091#action_61091
 ] 

Ashwin Karpe edited comment on CAMEL-3031 at 8/6/10 3:12 PM:
-------------------------------------------------------------

Hi Claus,

This is a rather serious issue. I also verified that direct endpoints for camel 
contexts with the same context id in 2 different bundles cannot see each other. 
However they can indeed see each other using VM endpoints.

It seems Camel creates 2 separate camel contexts ignoring the fact that they 
have the same context id. i would have thought Spring would not allow this to 
happen and would use an existing bean and not instantiate a fresh one if the id 
was the same. 

In JMX, however, Camel seems to lists both contexts against the same context id.

Not sure whether the fix should be that the route should not be instantiated if 
a context already exists under the same name. I would hae thought Spring 
beahvior would be to automatically use the existing bean of the given id 
instead of failing. Also is a bundle the determinant for failure...?
Would this not be a problem then for applications that use Spring but not OSGi 
and do want to re-use the camel context...

Is it not better to see if a context already exists and re-use it... ?

Regards,

Ashwin... 

      was (Author: akarpe):
    Hi Claus,

This is a rather serious issue. I also verified that direct endpoints for camel 
contexts with the same context id in 2 different bundles cannot see each other. 
However they can indeed see each other using VM endpoints.

It seems Spring creates 2 separate camel contexts ignoring the fact that they 
have the same context id. While in JMX it lists them against the same context 
id.

Not ure whether the fix should be that the route should not be instantiated if 
a context already exists under the same name. I would hae thought Spring would 
automatically use the existing bean of the given id instead of failing. Also is 
a bundle the determinant for failure...?
This would be a problem then for applications that use Spring but not OSGi...

Is it not better to see if a context already exists and re-use it... ?

Regards,

Ashwin... 
  
> 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.

Reply via email to