camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > Camel JMX
Date Fri, 07 Oct 2011 08:40:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/2042/9/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CAMEL/Camel+JMX">Camel JMX</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~christian%2Bschneider">Christian Schneider</a>
    </h4>
        <br/>
                         <h4>Changes (3)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >h4. How to use the JMX NotificationListener to listen the camel events? <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">The Camel notification events give a coarse grained overview what is happening. You can see lifecycle event from context and endpoints and you can see exchanges being received by and sent to endpoints. <br> <br></td></tr>
            <tr><td class="diff-unchanged" >From *Camel 2.4* you can use a customer JMX NotificationListener to listen the camel events. <br>First you need to set up a JmxNotificationEventNotifier before you start the CamelContext. <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >{snippet:id=e2|lang=java|url=camel/trunk/camel-core/src/test/java/org/apache/camel/management/JmxNotificationEventNotifierTest.java} <br> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h4. Using the Tracer mbean to get fine grained tracing <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Additionally to the coarse grained notifications above Camel &gt; 2.9.0 support JMX Notification for fine grained trace events. <br>These can be found in the Tracer mbean. To activate fine grained tracing you first need to activate tracing on the context or on a route. <br>This can either be done when configuring the context or on the context / route mbeans. <br> <br>As a second step you have to set the jmxTraceNotifications attribute to true on the tracer. This can again be done when configuring the context or at runtime on the tracer mbean. <br> <br>Now you can register for TraceEvent Notifications on the Tracer MBean using JConsole. There will be one Notification for every step on the route with all exchange and message details. <br> <br> <br> <br>!jconsole_trace_notifications.png|border=1! <br> <br> <br></td></tr>
            <tr><td class="diff-unchanged" >h3. Using JMX for your own Camel Code <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="CamelJMX-CamelJMX"></a>Camel JMX</h2>

<p>Apache Camel has extensive support for JMX to allow you to monitor and control the Camel managed objects with a JMX client.<br/>
Camel also provides a <a href="/confluence/display/CAMEL/JMX" title="JMX">JMX</a> component that allows you to subscribe to MBean notifications. This page is about how to manage and monitor Camel using JMX.</p>

<h3><a name="CamelJMX-ActivatingJMXinCamel"></a>Activating JMX in Camel</h3>

<div>
<ul>
    <li><a href='#CamelJMX-CamelJMX'>Camel JMX</a></li>
<ul>
    <li><a href='#CamelJMX-ActivatingJMXinCamel'>Activating JMX in Camel</a></li>
<ul>
    <li><a href='#CamelJMX-UsingJMXtomanageApacheCamel'>Using JMX to manage Apache Camel</a></li>
    <li><a href='#CamelJMX-DisablingJMXinstrumentationagentinCamel'>Disabling JMX instrumentation agent in Camel</a></li>
    <li><a href='#CamelJMX-LocatingaMBeanServerintheJavaVM'>Locating a MBeanServer in the Java VM</a></li>
    <li><a href='#CamelJMX-CreatingJMXRMIConnectorServer'>Creating JMX RMI Connector Server</a></li>
    <li><a href='#CamelJMX-JMXServiceURL'>JMX Service URL</a></li>
    <li><a href='#CamelJMX-TheSystemPropertiesforCamelJMXsupport'>The SystemProperties for Camel JMX support</a></li>
    <li><a href='#CamelJMX-HowtouseauthenticationwithJMX'>How to use authentication with JMX</a></li>
    <li><a href='#CamelJMX-JMXinsideanApplicationServer'>JMX inside an Application Server</a></li>
<ul>
    <li><a href='#CamelJMX-Tomcat6'>Tomcat 6</a></li>
    <li><a href='#CamelJMX-JBossAS4'>JBoss AS 4</a></li>
    <li><a href='#CamelJMX-WebSphere'>WebSphere</a></li>
    <li><a href='#CamelJMX-OracleOC4j'>Oracle OC4j</a></li>
</ul>
    <li><a href='#CamelJMX-AdvancedJMXConfiguration'>Advanced JMX Configuration</a></li>
    <li><a href='#CamelJMX-Example%3A'>Example:</a></li>
    <li><a href='#CamelJMX-jmxAgentPropertiesReference'>jmxAgent Properties Reference</a></li>
    <li><a href='#CamelJMX-Configuringwhethertoregistermbeansalways%2Cfornewroutesorjustbydefault'>Configuring whether to register mbeans always, for new routes or just by default</a></li>
</ul>
    <li><a href='#CamelJMX-MonitoringCamelusingJMX'>Monitoring Camel using JMX</a></li>
<ul>
    <li><a href='#CamelJMX-UsingJConsoletomonitorCamel'>Using JConsole to monitor Camel</a></li>
    <li><a href='#CamelJMX-Whichendpointsareregistered'>Which endpoints are registered</a></li>
    <li><a href='#CamelJMX-Whichprocessorsareregistered'>Which processors are registered</a></li>
    <li><a href='#CamelJMX-HowtousetheJMXNotificationListenertolistenthecamelevents%3F'>How to use the JMX NotificationListener to listen the camel events?</a></li>
    <li><a href='#CamelJMX-UsingtheTracermbeantogetfinegrainedtracing'>Using the Tracer mbean to get fine grained tracing</a></li>
</ul>
    <li><a href='#CamelJMX-UsingJMXforyourownCamelCode'>Using JMX for your own Camel Code</a></li>
<ul>
    <li><a href='#CamelJMX-RegisteringyourownManagedEndpoints'>Registering your own Managed Endpoints</a></li>
    <li><a href='#CamelJMX-ProgrammingyourownManagedServices'>Programming your own Managed Services</a></li>
    <li><a href='#CamelJMX-ManagementNamingStrategy'>ManagementNamingStrategy</a></li>
    <li><a href='#CamelJMX-ManagementStrategy'>ManagementStrategy</a></li>
    <li><a href='#CamelJMX-Configuringlevelofgranularityforperformancestatistics'>Configuring level of granularity for performance statistics</a></li>
</ul>
    <li><a href='#CamelJMX-SeeAlso'>See Also</a></li>
</ul>
</ul></div>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Spring JAR dependency, required for Camel 2.8 or older</b><br /><tt>spring-context.jar</tt>, <tt>spring-aop.jar</tt>, <tt>spring-beans.jar</tt>, and <tt>spring-core.jar</tt> is needed on the classpath by Camel to be able to use JMX instrumentation. If these .jars is not on the classpath Camel will fallback to non JMX mode. This situation is logged at <tt>WARN</tt> level using logger name <tt>org.apache.camel.impl.DefaultCamelContext</tt>.

<p>From <b>Camel 2.9</b> onwards, the Spring JARs is <b>no</b> longer required, to run Camel in JMX mode.</p></td></tr></table></div>

<h4><a name="CamelJMX-UsingJMXtomanageApacheCamel"></a>Using JMX to manage Apache Camel</h4>

<p>By default, JMX instrumentation agent is enabled in Camel which means that Camel runtime creates and registers MBean management objects with a MBeanServer instance in the VM. This allows Camel users instantly obtain insights into how Camel routes perform down to the individual processor's level.</p>

<p>The supported types of management objects are <a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/management/ManagedEndpoint.html" class="external-link" rel="nofollow">endpoint </a>, <a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/management/ManagedRoute.html" class="external-link" rel="nofollow">route</a>, <a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/management/ManagedService.html" class="external-link" rel="nofollow">service</a>, and <a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/management/PerformanceCounter.html" class="external-link" rel="nofollow">processor</a>. Some of these management objects also expose lifecycle operations in addition to performance counter attributes.</p>

<p>The <a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/management/DefaultManagementNamingStrategy.html" class="external-link" rel="nofollow">DefaultManagementNamingStrategy</a> is the default naming strategy which builds object names used for MBean registration. By default, <b>org.apache.camel</b> is the domain name for all object names created by CamelNamingStrategy. The domain name of the MBean object can be configured by Java VM system property:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">-Dorg.apache.camel.jmx.mbeanObjectDomainName=your.domain.name
</pre>
</div></div>
<p>Or, by adding a <b>jmxAgent</b> element inside the camelContext element in Spring configuration:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">&lt;camelContext id=<span class="code-quote">"camel"</span> xmlns=<span class="code-quote">"http:<span class="code-comment">//camel.apache.org/schema/spring"</span>&gt;
</span>  &lt;jmxAgent id=<span class="code-quote">"agent"</span> mbeanObjectDomainName=<span class="code-quote">"your.domain.name"</span>/&gt;
    ...
&lt;/camelContext&gt;
</pre>
</div></div>
<p>Spring configuration always takes precedence over system properties when they both present. It is true for all of JMX related configurations.</p>

<h4><a name="CamelJMX-DisablingJMXinstrumentationagentinCamel"></a>Disabling JMX instrumentation agent in Camel</h4>

<p>You can disable JMX instrumentation agent by setting Java VM system property as follow. The property value is treated as boolean.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">-Dorg.apache.camel.jmx.disabled=<span class="code-keyword">true</span>
</pre>
</div></div>
<p>Or, by adding a <b>jmxAgent</b> element inside the camelContext element in Spring configuration:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">&lt;camelContext id=<span class="code-quote">"camel"</span> xmlns=<span class="code-quote">"http:<span class="code-comment">//camel.apache.org/schema/spring"</span>&gt;
</span>  &lt;jmxAgent id=<span class="code-quote">"agent"</span> disabled=<span class="code-quote">"<span class="code-keyword">true</span>"</span>/&gt;
    ...
&lt;/camelContext&gt;
</pre>
</div></div>

<p>Or in Camel 2.1 its a bit easier (not having to use JVM system property) if using pure Java as you can disable it as follows:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">CamelContext camel = <span class="code-keyword">new</span> DefaultCamelContext();
camel.disableJMX();
</pre>
</div></div>

<h4><a name="CamelJMX-LocatingaMBeanServerintheJavaVM"></a>Locating a MBeanServer in the Java VM</h4>

<p>Each CamelContext can have an instance of <a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/InstrumentationAgent.html" class="external-link" rel="nofollow">InstrumentationAgent</a> wrapped insider the <a href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/management/InstrumentationLifecycleStrategy.html" class="external-link" rel="nofollow">InstrumentationLifecycleStrategy</a>. The InstrumentationAgent is the object that interfaces with a <a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/management/MBeanServer.html" class="external-link" rel="nofollow">MBeanServer</a> to register/unregister Camel MBeans. Multiple CamelContexts/InstrumentationAgents can/should share a MBeanServer. By default, Camel runtime picks the first MBeanServer returned by <a href="http://java.sun.com/j2se/1.5.0/docs/api/javax/management/MBeanServerFactory.html#findMBeanServer(java.lang.String)" class="external-link" rel="nofollow">MBeanServerFactory.findMBeanServer method</a> that matches the default domain name of <b>org.apache.camel</b>.&nbsp; You may want to change the default domain name to match the MBeanServer instance that you are already using in your application.&nbsp; Especially, if your MBeanServer is attached to a JMX connector server, you will not need to create a connector server in Camel.</p>

<p>You can configure the matching default domain name via system property.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">-Dorg.apache.camel.jmx.mbeanServerDefaultDomain=&lt;your.domain.name&gt;
</pre>
</div></div>
<p>Or, by adding a <b>jmxAgent</b> element inside the camelContext element in Spring configuration:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">&lt;camelContext id=<span class="code-quote">"camel"</span> xmlns=<span class="code-quote">"http:<span class="code-comment">//camel.apache.org/schema/spring"</span>&gt;
</span>  &lt;jmxAgent id=<span class="code-quote">"agent"</span> mbeanServerDefaultDomain=<span class="code-quote">"your.domain.name"</span>/&gt;
    ...
&lt;/camelContext&gt;
</pre>
</div></div>
<p>If no matching MBeanServer can be found, a new one is created and the new MBeanServer's default domain name is set according to the default and configuration as mentioned above.</p>

<p>It is also possible to use the <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/management/ManagementFactory.html#getPlatformMBeanServer()" class="external-link" rel="nofollow">PlatformMBeanServer</a> when it is desirable to manage JVM MBeans&nbsp;by setting the system property.&nbsp; The MBeanServer default domain name configuration is ignored as it is not applicable.&nbsp; <b>Starting in next release (1.5), the default value of usePlatformMBeanServer will be changed to "True".&nbsp; You can set the property to "False" to disable using platform MBean server.</b></p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">-Dorg.apache.camel.jmx.usePlatformMBeanServer=True
</pre>
</div></div>
<p>Or, by adding a <b>jmxAgent</b> element inside the camelContext element in Spring configuration:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">&lt;camelContext id=<span class="code-quote">"camel"</span> xmlns=<span class="code-quote">"http:<span class="code-comment">//camel.apache.org/schema/spring"</span>&gt;
</span>  &lt;jmxAgent id=<span class="code-quote">"agent"</span> usePlatformMBeanServer=<span class="code-quote">"<span class="code-keyword">true</span>"</span>/&gt;
    ...
&lt;/camelContext&gt;
</pre>
</div></div>

<h4><a name="CamelJMX-CreatingJMXRMIConnectorServer"></a>Creating JMX RMI Connector Server</h4>

<p>JMX connector server enables MBeans to be remotely managed by a JMX client such as JConsole.&nbsp; Camel JMX RMI connector server can be optionally turned on by setting system property and the MBeanServer used by Camel is attached to that connector server.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">-Dorg.apache.camel.jmx.createRmiConnector=True
</pre>
</div></div>
<p>Or, by adding a <b>jmxAgent</b> element inside the camelContext element in Spring configuration:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">&lt;camelContext id=<span class="code-quote">"camel"</span> xmlns=<span class="code-quote">"http:<span class="code-comment">//camel.apache.org/schema/spring"</span>&gt;
</span>  &lt;jmxAgent id=<span class="code-quote">"agent"</span> createConnector=<span class="code-quote">"<span class="code-keyword">true</span>"</span>/&gt;
    ...
&lt;/camelContext&gt;
</pre>
</div></div>

<h4><a name="CamelJMX-JMXServiceURL"></a>JMX Service URL</h4>

<p>The default JMX Service URL has the format:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">service:jmx:rmi:<span class="code-comment">///jndi/rmi://localhost:&lt;registryPort&gt;/&lt;serviceUrlPath&gt;</span>
</pre>
</div></div>
<p><em>registryPort</em> is the RMI registry port and the default value is <b>1099</b>.</p>

<p>You can set the RMI registry port by system property.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">-Dorg.apache.camel.jmx.rmiConnector.registryPort=&lt;port number&gt;
</pre>
</div></div>
<p>Or, by adding a <b>jmxAgent</b> element inside the camelContext element in Spring configuration:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">&lt;camelContext id=<span class="code-quote">"camel"</span> xmlns=<span class="code-quote">"http:<span class="code-comment">//camel.apache.org/schema/spring"</span>&gt;
</span>  &lt;jmxAgent id=<span class="code-quote">"agent"</span> createConnector=<span class="code-quote">"<span class="code-keyword">true</span>"</span> registryPort=<span class="code-quote">"port number"</span>/&gt;
    ...
&lt;/camelContext&gt;
</pre>
</div></div>
<p><em>serviceUrlPath</em> is the path name in the URL and the default value is <b>/jmxrmi/camel</b>.</p>

<p>You can set the service URL path by system property.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">-Dorg.apache.camel.jmx.serviceUrlPath=&lt;path&gt;
</pre>
</div></div>

<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Setting ManagementAgent settings in Java</b><br />In <b>Camel 2.4</b> onwards you can also set the various options on the <tt>ManagementAgent</tt>:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">context.getManagementStrategy().getManagementAgent().setServiceUrlPath(<span class="code-quote">"/foo/bar"</span>);
context.getManagementStrategy().getManagementAgent().setRegistryPort(2113);
context.getManagementStrategy().getManagementAgent().setCreateConnector(<span class="code-keyword">true</span>);
</pre>
</div></div></td></tr></table></div>

<p>Or, by adding a <b>jmxAgent</b> element inside the camelContext element in Spring configuration:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">&lt;camelContext id=<span class="code-quote">"camel"</span> xmlns=<span class="code-quote">"http:<span class="code-comment">//camel.apache.org/schema/spring"</span>&gt;
</span>  &lt;jmxAgent id=<span class="code-quote">"agent"</span> createConnector=<span class="code-quote">"<span class="code-keyword">true</span>"</span> serviceUrlPath=<span class="code-quote">"path"</span>/&gt;
    ...
&lt;/camelContext&gt;
</pre>
</div></div>
<p>By default, RMI server object listens on a dynamically generated port which can be a problem for connection established through a firewall. In such situation, RMI connection port can be explicitly set by the system property.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">-Dorg.apache.camel.jmx.rmiConnector.connectorPort=&lt;port number&gt;
</pre>
</div></div>
<p>Or, by adding a <b>jmxAgent</b> element inside the camelContext element in Spring configuration:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">&lt;camelContext id=<span class="code-quote">"camel"</span> xmlns=<span class="code-quote">"http:<span class="code-comment">//activemq.apache.org/camel/schema/spring"</span>&gt;
</span>  &lt;jmxAgent id=<span class="code-quote">"agent"</span> createConnector=<span class="code-quote">"<span class="code-keyword">true</span>"</span> connectorPort=<span class="code-quote">"port number"</span>/&gt;
    ...
&lt;/camelContext&gt;
</pre>
</div></div>
<p>When the connector port option is set, the JMX service URL will become:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">service:jmx:rmi:<span class="code-comment">//localhost:&lt;connectorPort&gt;/jndi/rmi://localhost:&lt;registryPort&gt;/&lt;serviceUrlPath&gt;</span>
</pre>
</div></div>

<h4><a name="CamelJMX-TheSystemPropertiesforCamelJMXsupport"></a>The SystemProperties for Camel JMX support</h4>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Property Name </th>
<th class='confluenceTh'> value </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> org.apache.camel.jmx </td>
<td class='confluenceTd'> true or false </td>
<td class='confluenceTd'> if is true , it will enable jmx feature in Camel </td>
</tr>
</tbody></table>
</div>


<p>See more system properties in this section below: <em>jmxAgent Properties Reference</em></p>


<h4><a name="CamelJMX-HowtouseauthenticationwithJMX"></a>How to use authentication with JMX</h4>

<p>JMX in the JDK have features for authentication and also for using secure connections over SSL. You have to refer to the SUN documentation how to use this:</p>
<ul class="alternate" type="square">
	<li><a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html" class="external-link" rel="nofollow">http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html</a></li>
	<li><a href="http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html" class="external-link" rel="nofollow">http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html</a></li>
</ul>



<h4><a name="CamelJMX-JMXinsideanApplicationServer"></a>JMX inside an Application Server</h4>

<h5><a name="CamelJMX-Tomcat6"></a>Tomcat 6</h5>

<p>See <a href="http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html" class="external-link" rel="nofollow">this page</a> for details about enabling JMX in Tomcat.</p>

<p>In short, modify your catalina.sh (or catalina.bat in Windows) file to set the following options...</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"> set CATALINA_OPTS=-Dcom.sun.management.jmxremote \
    -Dcom.sun.management.jmxremote.port=1099 \
    -Dcom.sun.management.jmxremote.ssl=<span class="code-keyword">false</span> \
    -Dcom.sun.management.jmxremote.authenticate=<span class="code-keyword">false</span>
</pre>
</div></div>

<h5><a name="CamelJMX-JBossAS4"></a>JBoss AS 4</h5>

<p>By default JBoss creates its own MBean server.  To allow Camel to expose to the same server follow these steps:</p>

<p>1. Tell Camel to use the Platform MBean Server (This defaults to true in Camel 1.5)</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">&lt;camel:camelContext id=<span class="code-quote">"camelContext"</span>&gt;
  &lt;camel:jmxAgent id=<span class="code-quote">"jmxAgent"</span> mbeanObjectDomainName=<span class="code-quote">"org.yourname"</span> usePlatformMBeanServer=<span class="code-quote">"<span class="code-keyword">true</span>"</span>  /&gt;
&lt;/camel:camelContext&gt;
</pre>
</div></div>

<p>2. Alter your JBoss instance to use the Platform MBean server.<br/>
Add the following property to your JAVA_OPTS by editing run.sh or run.conf {{ &#45;Djboss.platform.mbeanserver }} See <a href="http://wiki.jboss.org/wiki/JBossMBeansInJConsole" class="external-link" rel="nofollow">http://wiki.jboss.org/wiki/JBossMBeansInJConsole</a></p>




<h5><a name="CamelJMX-WebSphere"></a>WebSphere</h5>

<p>Alter the mbeanServerDefaultDomain to be "WebSphere"</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">&lt;camel:jmxAgent id=<span class="code-quote">"agent"</span> createConnector=<span class="code-quote">"<span class="code-keyword">true</span>"</span> mbeanObjectDomainName=<span class="code-quote">"org.yourname"</span> mbeanServerDefaultDomain=<span class="code-quote">"WebSphere"</span>/&gt;
</pre>
</div></div>

<h5><a name="CamelJMX-OracleOC4j"></a>Oracle OC4j</h5>

<p>The Oracle OC4J J2EE application server will not allow Camel to access the platform mbean server. You can identify this in the log as Camel will log a WARNING.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">xxx xx, xxxx xx:xx:xx xx org.apache.camel.management.InstrumentationLifecycleStrategy onContextStart
WARNING: Could not register CamelContext MBean
java.lang.SecurityException: Unauthorized access from application: xx to MBean: java.lang:type=ClassLoading
        at oracle.oc4j.admin.jmx.shared.UserMBeanServer.checkRegisterAccess(UserMBeanServer.java:873)
</pre>
</div></div>
<p>To resolve this you should disable the JMX agent in Camel, see section <em>Disabling JMX instrumentation agent in Camel</em></p>


<h4><a name="CamelJMX-AdvancedJMXConfiguration"></a>Advanced JMX Configuration</h4>

<p>The spring configuration file allows you to configure how Camel is exposed to JMX for management. In some cases, you could specify more information here, like the connector's port or the path name.</p>

<h4><a name="CamelJMX-Example%3A"></a>Example:</h4>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">&lt;camelContext id=<span class="code-quote">"camel"</span> xmlns=<span class="code-quote">"http:<span class="code-comment">//camel.apache.org/schema/spring"</span>&gt;
</span>  &lt;jmxAgent id=<span class="code-quote">"agent"</span> createConnector=<span class="code-quote">"<span class="code-keyword">true</span>"</span> registryPort=<span class="code-quote">"2000"</span> mbeanServerDefaultDomain=<span class="code-quote">"org.apache.camel.test"</span>/&gt;
    &lt;route&gt;
      &lt;from uri=<span class="code-quote">"seda:start"</span>/&gt;
      &lt;to uri=<span class="code-quote">"mock:result"</span>/&gt;
    &lt;/route&gt;
&lt;/camelContext&gt;
</pre>
</div></div>
<p>If you wish to change the Java 5 JMX settings you can use various <a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html#properties" class="external-link" rel="nofollow">JMX system properties</a></p>




<p>For example you can enable remote JMX connections to the Sun JMX connector, via setting the following environment variable (using <b>set</b> or <b>export</b> depending on your platform). These settings only configure the Sun JMX connector within Java 1.5+, not the JMX connector that Camel creates by default.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">SUNJMX=-Dcom.sun.management.jmxremote=<span class="code-keyword">true</span> -Dcom.sun.management.jmxremote.port=1616 \
-Dcom.sun.management.jmxremote.authenticate=<span class="code-keyword">false</span> -Dcom.sun.management.jmxremote.ssl=<span class="code-keyword">false</span>
</pre>
</div></div>
<p>(The SUNJMX environment variable is simple used by the startup script for Camel, as additional startup parameters for the JVM. If you start Camel directly, you'll have to pass these parameters yourself.)</p>

<h4><a name="CamelJMX-jmxAgentPropertiesReference"></a>jmxAgent Properties Reference</h4>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Spring property </th>
<th class='confluenceTh'> System property </th>
<th class='confluenceTh'> Default Value </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> id </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> The JMX agent name, and it is not optional </td>
</tr>
<tr>
<td class='confluenceTd'> usePlatformMBeanServer </td>
<td class='confluenceTd'> org.apache.camel.jmx.usePlatformMBeanServer </td>
<td class='confluenceTd'> false, true - Release 1.5 or later </td>
<td class='confluenceTd'> If true then it will use the plateform MBean server form the JVM </td>
</tr>
<tr>
<td class='confluenceTd'> mbeanServerDefaultDomain </td>
<td class='confluenceTd'> org.apache.camel.jmx.mbeanServerDefaultDomain </td>
<td class='confluenceTd'> org.apache.camel </td>
<td class='confluenceTd'> The default JMX domain of the MBeanServer </td>
</tr>
<tr>
<td class='confluenceTd'> mbeanObjectDomainName </td>
<td class='confluenceTd'> org.apache.camel.jmx.mbeanObjectDomainName </td>
<td class='confluenceTd'> org.apache.camel </td>
<td class='confluenceTd'> The JMX domain that all objects names will use </td>
</tr>
<tr>
<td class='confluenceTd'> createConnector </td>
<td class='confluenceTd'> org.apache.camel.jmx.createRmiConnect </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> If we should create a JMX connector (to allow remote management) for the MBeanServer </td>
</tr>
<tr>
<td class='confluenceTd'> registryPort </td>
<td class='confluenceTd'> org.apache.camel.jmx.rmiConnector.registryPort </td>
<td class='confluenceTd'> 1099 </td>
<td class='confluenceTd'> The port that the JMX RMI registry will use </td>
</tr>
<tr>
<td class='confluenceTd'> connectorPort </td>
<td class='confluenceTd'> org.apache.camel.jmx.rmiConnector.connectorPort </td>
<td class='confluenceTd'> &#45;1 (dynamic) </td>
<td class='confluenceTd'> The port that the JMX RMI server will use </td>
</tr>
<tr>
<td class='confluenceTd'> serviceUrlPath </td>
<td class='confluenceTd'> org.apache.camel.jmx.serviceUrlPath </td>
<td class='confluenceTd'> /jmxrmi/camel </td>
<td class='confluenceTd'> The path that JMX connector will be registered under </td>
</tr>
<tr>
<td class='confluenceTd'> onlyRegisterProcessorWithCustomId </td>
<td class='confluenceTd'> org.apache.camel.jmx.onlyRegisterProcessorWithCustomId </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> <b>Camel 2.0:</b> If this option is enabled then only processors with a custom id set will be registered. This allows you to filer out unwanted processors in the JMX console. </td>
</tr>
<tr>
<td class='confluenceTd'> statisticsLevel </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> <tt>All</tt> </td>
<td class='confluenceTd'> <b>Camel 2.1:</b> Configures the level for whether performance statistics is enabled for the mbean. See section <em>Configuring level of granularity for performance statistics</em> for more details. </td>
</tr>
</tbody></table>
</div>


<h4><a name="CamelJMX-Configuringwhethertoregistermbeansalways%2Cfornewroutesorjustbydefault"></a>Configuring whether to register mbeans always, for new routes or just by default</h4>

<p><b>Available as of Camel 2.7</b></p>

<p>Camel now offers 2 settings to control whether or not to register mbeans</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Option </th>
<th class='confluenceTh'> Default </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> registerAlways </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> If enabled then mbeans is always registered. </td>
</tr>
<tr>
<td class='confluenceTd'> registerNewRoutes </td>
<td class='confluenceTd'> true </td>
<td class='confluenceTd'> If enabled then adding new routes after <a href="/confluence/display/CAMEL/CamelContext" title="CamelContext">CamelContext</a> has been started will also register mbeans from that given route. </td>
</tr>
</tbody></table>
</div>


<p>By default Camel registers mbeans for all the routes configured when its starting. The <tt>registerNewRoutes</tt> option control if mbeans should also be registered if you add new routes thereafter. You can disable this, if you for example add and remove temporary routes where management is not needed.</p>

<p>Be a bit caution to use the registerAlways option when using dynamic <a href="/confluence/display/CAMEL/EIP" title="EIP">EIP</a> patterns such as the <a href="/confluence/display/CAMEL/Recipient+List" title="Recipient List">Recipient List</a> having unique endpoints. If so then each unique endpoint and its associated services/producers would also be registered. This could potential lead to system degration due the rising number of mbeans in the registry. A MBean is not a light-weight object and thus consume memory.</p>

<h3><a name="CamelJMX-MonitoringCamelusingJMX"></a>Monitoring Camel using JMX</h3>

<h4><a name="CamelJMX-UsingJConsoletomonitorCamel"></a>Using JConsole to monitor Camel</h4>

<p>The CamelContext should appear in the list of local connections, if you are running JConsole on the same host as Camel.</p>

<p>To connect to a remote Camel instance, or if the local process does  not show up, use Remote Process option, and enter an URL. Here is an  example localhost URL:service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi/camel</p>

<p>Using the Apache Camel which Jconsole</p>

<p><span class="image-wrap" style=""><img src="/confluence/download/attachments/85697/camel-jmx.png?version=1&amp;modificationDate=1224695081000" style="border: 1px solid black" /></span></p>

<h4><a name="CamelJMX-Whichendpointsareregistered"></a>Which endpoints are registered</h4>

<p>In <b>Camel 2.1</b> onwards <b>only</b> <tt>singleton</tt> endpoints are registered as the overhead for non singleton will be substantial in cases where thousands or millions of endpoints are used. This can happens when using a <a href="/confluence/display/CAMEL/Recipient+List" title="Recipient List">Recipient List</a> EIP or from a <tt>ProducerTemplate</tt> that sends a lot of messages.</p>

<h4><a name="CamelJMX-Whichprocessorsareregistered"></a>Which processors are registered</h4>

<p>See <a href="/confluence/display/CAMEL/Why+is+my+processor+not+showing+up+in+JConsole" title="Why is my processor not showing up in JConsole">this FAQ</a>.</p>

<h4><a name="CamelJMX-HowtousetheJMXNotificationListenertolistenthecamelevents%3F"></a>How to use the JMX NotificationListener to listen the camel events?</h4>

<p>The Camel notification events give a coarse grained overview what is happening. You can see lifecycle event from context and endpoints and you can see exchanges being received by and sent to endpoints.</p>

<p>From <b>Camel 2.4</b> you can use a customer JMX NotificationListener to listen the camel events.<br/>
First you need to set up a JmxNotificationEventNotifier before you start the CamelContext.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"><span class="code-comment">// Set up the JmxNotificationEventNotifier
</span>notifier = <span class="code-keyword">new</span> JmxNotificationEventNotifier();
notifier.setSource(<span class="code-quote">"MyCamel"</span>);
notifier.setIgnoreCamelContextEvents(<span class="code-keyword">true</span>);
notifier.setIgnoreRouteEvents(<span class="code-keyword">true</span>);
notifier.setIgnoreServiceEvents(<span class="code-keyword">true</span>);

CamelContext context = <span class="code-keyword">new</span> DefaultCamelContext(createRegistry());
context.getManagementStrategy().addEventNotifier(notifier);

<span class="code-comment">// Set up the ManagementNamingStrategy
</span>DefaultManagementNamingStrategy naming = (DefaultManagementNamingStrategy) context.getManagementStrategy().getManagementNamingStrategy();
naming.setHostName(<span class="code-quote">"localhost"</span>);
naming.setDomainName(<span class="code-quote">"org.apache.camel"</span>);
</pre>
</div></div>

<p>Second you can register your listener for listening the event</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java"><span class="code-comment">// register the NotificationListener
</span>ObjectName on = ObjectName.getInstance(<span class="code-quote">"org.apache.camel:context=localhost/camel-1,type=eventnotifiers,name=JmxEventNotifier"</span>);
MyNotificationListener listener = <span class="code-keyword">new</span> MyNotificationListener();   
context.getManagementStrategy().getManagementAgent().getMBeanServer().addNotificationListener(on,
    listener,                                                                                         
    <span class="code-keyword">new</span> NotificationFilter() {
        <span class="code-keyword">public</span> <span class="code-object">boolean</span> isNotificationEnabled(Notification notification) {
            <span class="code-keyword">return</span> notification.getSource().equals(<span class="code-quote">"MyCamel"</span>);
        }
    }, <span class="code-keyword">null</span>);

</pre>
</div></div>

<h4><a name="CamelJMX-UsingtheTracermbeantogetfinegrainedtracing"></a>Using the Tracer mbean to get fine grained tracing</h4>

<p>Additionally to the coarse grained notifications above Camel &gt; 2.9.0 support JMX Notification for fine grained trace events.<br/>
These can be found in the Tracer mbean. To activate fine grained tracing you first need to activate tracing on the context or on a route.<br/>
This can either be done when configuring the context or on the context / route mbeans.</p>

<p>As a second step you have to set the jmxTraceNotifications attribute to true on the tracer. This can again be done when configuring the context or at runtime on the tracer mbean.</p>

<p>Now you can register for TraceEvent Notifications on the Tracer MBean using JConsole. There will be one Notification for every step on the route with all exchange and message details.</p>



<p><span class="image-wrap" style=""><img src="/confluence/download/attachments/85697/jconsole_trace_notifications.png?version=1&amp;modificationDate=1317976147544" style="border: 1px solid black" /></span></p>


<h3><a name="CamelJMX-UsingJMXforyourownCamelCode"></a>Using JMX for your own Camel Code</h3>

<h4><a name="CamelJMX-RegisteringyourownManagedEndpoints"></a>Registering your own Managed Endpoints</h4>

<p><b>Available as of Camel 2.0</b><br/>
You can decorate your own endpoints with spring managed annotations <tt>@ManagedResource</tt> to allow to register them in the Camel mbean server and thus access your custom mbeans using JMX.<br/>
<b>Notice:</b> in <b>Camel 2.1</b> we have changed this to apply other than just endpoints but then you need to implement the interface <tt>org.apache.camel.spi.ManagementAware</tt> as well. More about this later.</p>

<p>For example we have the following custom endpoint where we define some options to be managed:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">@ManagedResource(description = <span class="code-quote">"Our custom managed endpoint"</span>)
<span class="code-keyword">public</span> class CustomEndpoint <span class="code-keyword">extends</span> MockEndpoint <span class="code-keyword">implements</span> ManagementAware&lt;CustomEndpoint&gt; {

    <span class="code-keyword">public</span> CustomEndpoint(<span class="code-keyword">final</span> <span class="code-object">String</span> endpointUri, <span class="code-keyword">final</span> Component component) {
        <span class="code-keyword">super</span>(endpointUri, component);
    }

    <span class="code-keyword">public</span> <span class="code-object">Object</span> getManagedObject(CustomEndpoint object) {
        <span class="code-keyword">return</span> <span class="code-keyword">this</span>;
    }

    <span class="code-keyword">public</span> <span class="code-object">boolean</span> isSingleton() {
        <span class="code-keyword">return</span> <span class="code-keyword">true</span>;
    }

    <span class="code-keyword">protected</span> <span class="code-object">String</span> createEndpointUri() {
        <span class="code-keyword">return</span> <span class="code-quote">"custom"</span>;
    }

    @ManagedAttribute
    <span class="code-keyword">public</span> <span class="code-object">String</span> getFoo() {
        <span class="code-keyword">return</span> <span class="code-quote">"bar"</span>;
    }

    @ManagedAttribute
    <span class="code-keyword">public</span> <span class="code-object">String</span> getEndpointUri() {
        <span class="code-keyword">return</span> <span class="code-keyword">super</span>.getEndpointUri();
    }
}
</pre>
</div></div>

<p>Notice from Camel 2.9 onwards its encouraged to use the <tt>@ManagedResource</tt>, <tt>@ManagedAttribute</tt>, and <tt>@ManagedOperation</tt> from the <tt>org.apache.camel.management.ManagedResource</tt> package. This allows your custom code to not depend on Spring JARs.</p>

<h4><a name="CamelJMX-ProgrammingyourownManagedServices"></a>Programming your own Managed Services</h4>

<p><b>Available as of Camel 2.1</b></p>

<p>Camel now offers to use your own mbeans when registering services for management. What that means is for example you can develop a custom Camel component and have it expose mbeans for endpoints, consumers and producers etc. All you need to do is to implement the interface <tt>org.apache.camel.spi.ManagementAware</tt> and return the managed object Camel should use.</p>

<p>Now before you think oh boys the JMX API is really painful and terrible, then yeah you are right. Lucky for us Spring though too and they created a range of annotations you can use to export management on an existing bean. That means that you often use that and just return <tt>this</tt> in the <tt>getManagedObject</tt> from the <tt>ManagementAware</tt> interface. For an example see the code example above with the <tt>CustomEndpoint</tt>.</p>

<p>Now in Camel 2.1 you can do this for all the objects that Camel registers for management which are quite a bunch, but not all.</p>

<p>For services which do not implement this <tt>ManagementAware</tt> interface then Camel will fallback to using default wrappers as defined in the table below:</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> MBean wrapper </th>
</tr>
<tr>
<td class='confluenceTd'> CamelContext </td>
<td class='confluenceTd'> ManagedCamelContext </td>
</tr>
<tr>
<td class='confluenceTd'> Component </td>
<td class='confluenceTd'> ManagedComponent </td>
</tr>
<tr>
<td class='confluenceTd'> Endpoint </td>
<td class='confluenceTd'> ManagedEndpoint </td>
</tr>
<tr>
<td class='confluenceTd'> Consumer </td>
<td class='confluenceTd'> ManagedConsumer </td>
</tr>
<tr>
<td class='confluenceTd'> Producer </td>
<td class='confluenceTd'> ManagedProducer </td>
</tr>
<tr>
<td class='confluenceTd'> Route </td>
<td class='confluenceTd'> ManagedRoute </td>
</tr>
<tr>
<td class='confluenceTd'> Processor </td>
<td class='confluenceTd'> ManagedProcessor </td>
</tr>
<tr>
<td class='confluenceTd'> Tracer </td>
<td class='confluenceTd'> ManagedTracer </td>
</tr>
<tr>
<td class='confluenceTd'> Service </td>
<td class='confluenceTd'> ManagedService </td>
</tr>
</tbody></table>
</div>


<p>In addition to that there are some extended wrappers for specialized types such as</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> MBean wrapper </th>
</tr>
<tr>
<td class='confluenceTd'> ScheduledPollConsumer </td>
<td class='confluenceTd'> ManagedScheduledPollConsumer </td>
</tr>
<tr>
<td class='confluenceTd'> BrowsableEndpoint </td>
<td class='confluenceTd'> ManagedBrowseableEndpoint </td>
</tr>
<tr>
<td class='confluenceTd'> Throttler </td>
<td class='confluenceTd'> ManagedThrottler </td>
</tr>
<tr>
<td class='confluenceTd'> Delayer </td>
<td class='confluenceTd'> ManagedDelayer </td>
</tr>
<tr>
<td class='confluenceTd'> SendProcessor </td>
<td class='confluenceTd'> ManagedSendProcessor </td>
</tr>
</tbody></table>
</div>


<p>And in the future we will add additional wrappers for more EIP patterns.</p>

<h4><a name="CamelJMX-ManagementNamingStrategy"></a>ManagementNamingStrategy</h4>

<p><b>Available as of Camel 2.1</b></p>

<p>Camel provides a pluggable API for naming strategy by <tt>org.apache.camel.spi.ManagementNamingStrategy</tt>. A default implementation is used to compute the mbean names that all mbeans are registered with.</p>

<h4><a name="CamelJMX-ManagementStrategy"></a>ManagementStrategy</h4>

<p><b>Available as of Camel 2.1</b></p>

<p>Camel now provides a totally pluggable management strategy that allows you to be 100% in control of management. It is a rich interface with many methods for management. Not only for adding and removing managed objects from the mbean server but also event notification is provided as well using the <tt>org.apache.camel.spi.EventNotifier</tt> API. What it does for example is to easier provide an adapter for other management products. In additional it also allows you to provide more details and features that are provided out of the box at Apache.</p>

<h4><a name="CamelJMX-Configuringlevelofgranularityforperformancestatistics"></a>Configuring level of granularity for performance statistics</h4>

<p><b>Available as of Camel 2.1</b></p>

<p>You can now set a pre set level whether performance statistics is enabled or not when Camel start ups. The levels are</p>
<ul class="alternate" type="square">
	<li><tt>All</tt> <b>default</b> &#45; Camel will enable statistics for both routes and processors (fine grained)</li>
	<li><tt>RoutesOnly</tt> &#45; Camel will only enable statistics for routes (coarse grained)</li>
	<li><tt>Off</tt> &#45; Camel will not enable statistics for any.</li>
</ul>


<p>From <b>Camel 2.9</b> onwards the performance statistics also include average load statistics per CamelContext and Route mbeans. The statistics is average load based on the number of in flight exchanges, on a per 1, 5 and 15 minute rate. This is similar to load statistics on Unix systems.</p>

<p>At runtime you can always use the management console (such as jconsole) to change on a given route or processor whether its statistics are enabled or not.</p>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>What does statistics enabled mean?</b><br />Statistics enabled means that Camel will do fine grained performance statistics for that particular mbean. The statistics you can see are many such as: number of exchanges completed/failed, last/total/mina/max/mean processing time, first/last failed time etc.</td></tr></table></div>

<p>Using Java DSL you set this level by:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">  <span class="code-comment">// only enable routes when Camel starts
</span>  context.getManagementStrategy().setSatisticsLevel(ManagementStatisticsLevel.RoutesOnly);
</pre>
</div></div>

<p>And from Spring DSL you do:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">    <span class="code-tag">&lt;camelContext id=<span class="code-quote">"camel"</span> xmlns=<span class="code-quote">"http://camel.apache.org/schema/spring"</span>&gt;</span>
        <span class="code-tag">&lt;jmxAgent id=<span class="code-quote">"agent"</span> statisticsLevel=<span class="code-quote">"RoutesOnly"</span>/&gt;</span>
     ...
    <span class="code-tag">&lt;/camelContext&gt;</span>
</pre>
</div></div>


<h3><a name="CamelJMX-SeeAlso"></a>See Also</h3>

<ul class="alternate" type="square">
	<li><a href="/confluence/display/CAMEL/Management+Example" title="Management Example">Management Example</a></li>
	<li><a href="/confluence/display/CAMEL/Why+is+my+processor+not+showing+up+in+JConsole" title="Why is my processor not showing up in JConsole">Why is my processor not showing up in JConsole</a></li>
</ul>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action" class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/Camel+JMX">View Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=85697&revisedVersion=45&originalVersion=44">View Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/Camel+JMX?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message