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

Get Apache Camel Developer's Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.