JMX
Camel has optional support for JMX management, which is part of the
camel-management
and
camel-management-api
JARs.
Using JMX to manage Apache Camel
The JMX instrumentation agent is enabled in Camel when the
camel-management
JAR is included in the classpath. Once enabled, the Camel runtime creates and registers MBean management objects with a
MBeanServer
instance in the VM. This allows Camel users to instantly obtain insights into how Camel routes perform down to the individual processor level.
The high level supported types of management objects are:
Most of these management objects also expose lifecycle operations in addition to performance counter-attributes.
Disabling or enabling Camel JMX
JMX is only enabled in Camel when the
camel-management
JAR is included on the classpath. To quickly enable or disable JMX, simply add or remove this JAR from the classpath.
It is also possible to enable or disable JMX via configuration as documented below.
You can disable the JMX instrumentation agent by setting the Java VM system property as follows:
-Dorg.apache.camel.jmx.disabled=true
The property value is treated as
boolean
.
Alternatively, add a
jmxAgent
element inside the
camelContext
element in Spring XML configuration:
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<jmxAgent id="agent" disabled="true"/>
</camelContext>
In Java, you can disable JMX directly on the
CamelContext
as follows:
CamelContext camel = new DefaultCamelContext();