Camel routes get registered twice in my broker
Environment
- Fuse Message Broker 5.5.0
Issue
After starting Fuse Message Broker 5.5.0 all my Camel routes are registered twice.
The broker's log file contains this line:
This CamelContext(camel) will be registered using the name: camel-2 due to clash
with an existing name already registered in MBeanServer. |
org.apache.camel.management.DefaultManagementLifecycleStrategy
When connecting to the broker using jconsole, all Camel routes show up twice.
Resolution
Out of the box Fuse Message Broker already imports jetty.xml and deploys a couple of web applications. One of them is the Camel web console. The Camel web console already imports camel.xml and instantiates all the Camel routes.
If camel.xml gets imported additionally and directly from activemq.xml, then the very same Camel configuration will be instantiated twice.
The solution is typically to not include camel.xml in your activemq.xml but let the Camel web console application load the Camel configuration.
Root Cause
This is most likely caused by explicitly importing camel.xml in your broker configuration, e.g. using a configuration like this one
<!-- activemq.xml -->
<import resource="jetty.xml"/>
<import resource="camel.xml"/>
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
