Camel should auto find free CamelContext MBean name when registering Camel in 
JMX to avoid failing on startup due existing mbean name
-------------------------------------------------------------------------------------------------------------------------------------

                 Key: CAMEL-3324
                 URL: https://issues.apache.org/activemq/browse/CAMEL-3324
             Project: Apache Camel
          Issue Type: Improvement
          Components: osgi
    Affects Versions: 2.5.0
            Reporter: Claus Ibsen
            Assignee: Claus Ibsen
             Fix For: 2.6.0


This makes it much easier when running multiple Camel applications in the same 
JVM. You may have assigned a duplicate name in the CamelContext but in 
different WARs / bundles etc. Then previously Camel would not be able to start 
the 2nd application as the 1st had already taking the MBean name.

Instead Camel should auto remedy this by computing a free name to use instead.

For example

WAR-a
{code:xml}
<camelContext id="foo">
...
</camelContext>
{code}



WAR-b
{code:xml}
<camelContext id="foo">
...
</camelContext>
{code}

Now what happens is that
{code}
WAR-a : DEBUG Registered MBean with objectname: 
org.apache.camel:context=localhost/foo,type=context,name="foo"
...
WAR-b: WARN This CamelContext(foo) will be registered using the name: foo-2 due 
to clash with an existing name already registered in MBeanServer.
WAR-b DEBUG Registered MBean with objectname: 
org.apache.camel:context=localhost/foo-2,type=context,name="foo"
{code}

As you can see WAR-b has the MBean name reassigned to foo-2 to avoid the clash.

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