Configuring JMX
Camel, by default, enables JMX for all routes and endpoints it creates by default. This recipe shows you how to configure Camel's interaction with JMX.
Getting ready
The Java code for this recipe is located in the org.camelcookbook.monitoring.jmx
package. The Spring XML files are located under src/main/resources/META-INF/spring
and prefixed with jmx
.
How to do it...
In the XML DSL, create a jmxAgent
element within the camelContext
element, and configure the Camel JMX options:
<camelContext xmlns="http://camel.apache.org/schema/spring"> <jmxAgent id="agent" connectorPort="1099" createConnector="false" usePlatformMBeanServer="true" serviceUrlPath="/jmxrmi/camel" loadStatisticsEnabled="true" statisticsLevel="All"/> <!-- route definitions here --> </camelContext>
Note
You must set the id
attribute in...