-
Book Overview & Buying
-
Table Of Contents
Apache Camel Developer's Cookbook
By :
Camel, by default, enables JMX for all routes and endpoints it creates by default. Sometimes, such as when you are performance testing Camel, you do not want any of the JMX metric-gathering to add any extra overhead, so you may want to disable JMX. In general, it is a good idea to leave JMX enabled, as you will find it useful to help diagnose any runtime issues.
This recipe shows you how to disable JMX.
The Java code for this recipe is located in the org.camelcookbook.monitoring.jmxdisable package. The Spring XML files are located under src/main/resources/META-INF/spring and prefixed with jmx-disable.
In the XML DSL, create a jmxAgent element within the camelContext element, and set disabled to true:
<camelContext xmlns="http://camel.apache.org/schema/spring">
<jmxAgent id="agent" disabled="true"/>
<!-- route definitions here -->
</camelContext>You must set the id attribute in the jmxAgent...