Naming your routes to make it easier to monitor
Camel, by default, enables JMX on order to allow you to monitor in fine detail your Camel integration routes. Setting meaningful names for your Camel context, and individual routes makes it easier to identify them in your monitoring environment. This recipe will show you how to set specific names for those elements.
Getting ready
The Java code for this recipe is located in the org.camelcookbook.monitoring.naming
package. The Spring XML files are located under src/main/resources/META-INF/spring
and prefixed with naming
.
How to do it...
In the XML DSL, specify id
attributes for the camelContext
and route
elements, as these values will be used as the JMX names. You can optionally add the jmxAgent
element if you need to customize the JMX configuration for Camel; see the Configuring JMX recipe for more details.
<camelContext id="myCamelContextName"
xmlns="http://camel.apache.org/schema/spring">
<jmxAgent...