Author: buildbot Date: Wed Aug 24 17:18:47 2016 New Revision: 995817 Log: Production update by buildbot for camel
Modified: websites/production/camel/content/cache/main.pageCache websites/production/camel/content/camel-jmx.html Modified: websites/production/camel/content/cache/main.pageCache ============================================================================== Binary files - no diff available. Modified: websites/production/camel/content/camel-jmx.html ============================================================================== --- websites/production/camel/content/camel-jmx.html (original) +++ websites/production/camel/content/camel-jmx.html Wed Aug 24 17:18:47 2016 @@ -86,10 +86,10 @@ <tbody> <tr> <td valign="top" width="100%"> -<div class="wiki-content maincontent"><h2 id="CamelJMX-CamelJMX">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 clear="none"> Camel also provides a <a shape="rect" href="jmx.html">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 id="CamelJMX-ActivatingJMXinCamel">Activating JMX in Camel</h3><p></p><div class="toc-macro client-side-toc-macro" data-headerelements="H1,H2,H3,H4,H5,H6,H7"></div><div class="confluence-information-macro confluence-information-macro-information"><p class="title">Spring JAR dependency, required for Camel 2.8 or older</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p><code>spring-context.jar</code>, <code>spring-aop.jar</code>, <code>spring-beans.jar</code>, and <code>spring-c ore.jar</code> are needed on the classpath by Camel to be able to use JMX instrumentation. If these .jars are not on the classpath, Camel will fallback to non JMX mode. This situation is logged at <code>WARN</code> level using logger name <code>org.apache.camel.impl.DefaultCamelContext</code>.</p><p>From <strong>Camel 2.9</strong> onwards, the Spring JARs are <strong>no</strong> longer required to run Camel in JMX mode.</p></div></div><h4 id="CamelJMX-UsingJMXtomanageApacheCamel">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 <code>MBeanServer</code> instance in the VM. This allows Camel users to instantly obtain insights into how Camel routes perform down to the individual processor level.</p><p>The supported types of management objects are <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apa che/camel/management/mbean/ManagedEndpoint.html">endpoint</a>, <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/management/mbean/ManagedRoute.html">route</a>, <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/management/mbean/ManagedService.html">service</a>, and <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/management/mbean/ManagedProcessor.html">processor</a>. Some of these management objects also expose lifecycle operations in addition to performance counter attributes.</p><p>The <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/management/DefaultManagementNamingStrategy.html">DefaultManagementNamingStrategy</a> is the default naming strategy which builds object names used for MBean registration. By default, <strong>org.apache.camel</strong> 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 pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +<div class="wiki-content maincontent"><h2 id="CamelJMX-CamelJMX">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. Camel also provides a <a shape="rect" href="jmx.html">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 id="CamelJMX-ActivatingJMXinCamel">Activating JMX in Camel</h3><p></p><div class="toc-macro client-side-toc-macro" data-headerelements="H1,H2,H3,H4,H5,H6,H7"></div><div class="confluence-information-macro confluence-information-macro-information"><p class="title">Spring JAR Dependencies Required By Camel 2.8 or Older</p><span class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>The following Spring jar files must be on the classpath in order for Camel to be able to use JMX instrumentation:</p><ul><li><st rong><code>spring-context.jar</code></strong></li><li><strong><code>spring-aop.jar</code></strong></li><li><strong><code>spring-beans.jar</code></strong></li><li><strong><code>spring-core.jar</code></strong></li></ul><p>If these jar files are not on the classpath Camel will fallback to non JMX mode. Camel will log a warning to this affect using the logger: <strong><code>org.apache.camel.impl.DefaultCamelContext</code></strong>.</p><p><strong>From Camel 2.9:</strong> the Spring jar files are <strong>no</strong> longer required for Camel to run in JMX mode.</p></div></div><h4 id="CamelJMX-UsingJMXtomanageApacheCamel">Using JMX to manage Apache Camel</h4><p>By default, JMX instrumentation agent is <em>enabled</em> in Camel, which means that Camel runtime creates and registers MBean management objects with a <strong><code>MBeanServer</code></strong> instance in the VM. This allows Camel users to instantly obtain insights into how Camel routes perform down to the individual processor lev el.</p><p>The supported types of management objects are <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/management/mbean/ManagedEndpoint.html">endpoint</a>, <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/management/mbean/ManagedRoute.html">route</a>, <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/management/mbean/ManagedService.html">service</a>, and <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/management/mbean/ManagedProcessor.html">processor</a>. Some of these management objects also expose lifecycle operations in addition to performance counter attributes.</p><p>The <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/management/Default ManagementNamingStrategy.html">DefaultManagementNamingStrategy</a> is the default naming strategy which builds object names used for MBean registration. By default <strong><code>org.apache.camel</code></strong> is the domain name for all object names created by <strong><code>CamelNamingStrategy</code></strong>. The domain name of the MBean object can be configured by Java VM system property:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[-Dorg.apache.camel.jmx.mbeanObjectDomainName=your.domain.name ]]></script> -</div></div><p>Or, by adding a <strong>jmxAgent</strong> element inside the camelContext element in Spring configuration:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>Or, by adding a <strong><code>jmxAgent</code></strong> element inside the <strong><code>camelContext</code></strong> element in Spring configuration:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> <jmxAgent id="agent" mbeanObjectDomainName="your.domain.name"/> ... @@ -98,7 +98,7 @@ </div></div><p>Spring configuration always takes precedence over system properties when they both present. It is true for all JMX related configurations.</p><h4 id="CamelJMX-DisablingJMXinstrumentationagentinCamel">Disabling JMX instrumentation agent in Camel</h4><p>You can disable JMX instrumentation agent by setting the Java VM system property as follow. The property value is treated as <code>boolean</code>.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[-Dorg.apache.camel.jmx.disabled=true ]]></script> -</div></div><p>Or, by adding a <strong>jmxAgent</strong> element inside the <code>camelContext</code> element in Spring configuration:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>Or, by adding a <strong><code>jmxAgent</code></strong> element inside the <strong><code>camelContext</code></strong> element in Spring configuration:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> <jmxAgent id="agent" disabled="true"/> ... @@ -108,28 +108,28 @@ <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[CamelContext camel = new DefaultCamelContext(); camel.disableJMX(); ]]></script> -</div></div><h4 id="CamelJMX-LocatingaMBeanServerintheJavaVM">Locating a MBeanServer in the Java VM</h4><p>Each CamelContext can have an instance of <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/InstrumentationAgent.html">InstrumentationAgent</a> wrapped inside the <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/management/InstrumentationLifecycleStrategy.html">InstrumentationLifecycleStrategy</a>. The InstrumentationAgent is the object that interfaces with a <a shape="rect" class="external-link" href="http://java.sun.com/j2se/1.5.0/docs/api/javax/management/MBeanServer.html" rel="nofollow">MBeanServer</a> to register/unregister Camel MBeans. Multiple CamelContexts/InstrumentationAgents can/should share a <code>MBeanServer</code>. By default, Camel runtime picks the first <code>MBeanServer</code> returned by <a shape="rect" class="external -link" href="http://java.sun.com/j2se/1.5.0/docs/api/javax/management/MBeanServerFactory.html#findMBeanServer(java.lang.String)" rel="nofollow">MBeanServerFactory.findMBeanServer method</a> that matches the default domain name of <strong>org.apache.camel</strong>. You may want to change the default domain name to match the <code>MBeanServer</code> instance that you are already using in your application. Especially, if your <code>MBeanServer</code> 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 pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h4 id="CamelJMX-LocatingaMBeanServerintheJavaVM">Locating a MBeanServer in the Java VM</h4><p>Each CamelContext can have an instance of <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/InstrumentationAgent.html">InstrumentationAgent</a> wrapped inside the <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/management/InstrumentationLifecycleStrategy.html">InstrumentationLifecycleStrategy</a>. The InstrumentationAgent is the object that interfaces with a <a shape="rect" class="external-link" href="http://java.sun.com/j2se/1.5.0/docs/api/javax/management/MBeanServer.html" rel="nofollow">MBeanServer</a> to register/unregister Camel MBeans. Multiple CamelContexts/InstrumentationAgents can/should share a <strong><code>MBeanServer</code></strong>. By default, Camel runtime picks the first <strong><code>MBeanServer</code></strong> returned by <a shape="rect" class="external-link" href="http://java.sun.com/j2se/1.5.0/docs/api/javax/management/MBeanServerFactory.html#findMBeanServer(java.lang.String)" rel="nofollow">MBeanServerFactory.findMBeanServer method</a> that matches the default domain name of <strong><code>org.apache.camel</code></strong>. You may want to change the default domain name to match the <strong><code>MBeanServer</code></strong> instance that you are already using in your application. Especially, if your <strong><code>MBeanServer</code></strong> 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 pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[-Dorg.apache.camel.jmx.mbeanServerDefaultDomain=<your.domain.name> ]]></script> -</div></div><p>Or, by adding a <strong>jmxAgent</strong> element inside the camelContext element in Spring configuration:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>Or, by adding a <strong><code>jmxAgent</code></strong> element inside the <strong><code>camelContext</code></strong> element in Spring configuration:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> <jmxAgent id="agent" mbeanServerDefaultDomain="your.domain.name"/> ... </camelContext> ]]></script> -</div></div><p>If no matching <code>MBeanServer</code> can be found, a new one is created and the new <code>MBeanServer</code>'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 shape="rect" class="external-link" href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/management/ManagementFactory.html#getPlatformMBeanServer()" rel="nofollow">PlatformMBeanServer</a> when it is desirable to manage JVM MBeans by setting the system property. The <code>MBeanServer</code> default domain name configuration is ignored as it is not applicable. <strong>Starting in next release (1.5), the default value of <code>usePlatformMBeanServer</code> will be changed to "True". You can set the property to "False" to disable using platform <code>MBeanServer</code>.</strong></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>If no matching <strong><code>MBeanServer</code></strong> can be found, a new one is created and the new <strong><code>MBeanServer</code></strong>'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 shape="rect" class="external-link" href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/management/ManagementFactory.html#getPlatformMBeanServer()" rel="nofollow">PlatformMBeanServer</a> when it is desirable to manage JVM MBeans by setting the system property. The <strong><code>MBeanServer</code></strong> default domain name configuration is ignored as it is not applicable. </p><p><strong>From Camel 1.5</strong>: the default value of <strong><code>usePlatformMBeanServer</code></strong> is <strong><code>true</code></strong>. Set the property to <strong><code>false</code></strong> to disable using platform <strong><code>MBeanServer</code>.</strong></p><div class="code panel pdl" style="bor der-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[-Dorg.apache.camel.jmx.usePlatformMBeanServer=True ]]></script> -</div></div><p>Or, by adding a <strong>jmxAgent</strong> element inside the <code>camelContext</code> element in Spring configuration:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>Or, by adding a <strong><code>jmxAgent</code></strong> element inside the <strong><code>camelContext</code></strong> element in Spring configuration:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> <jmxAgent id="agent" usePlatformMBeanServer="true"/> ... </camelContext> ]]></script> -</div></div><h4 id="CamelJMX-CreatingJMXRMIConnectorServer">Creating JMX RMI Connector Server</h4><p>JMX connector server enables MBeans to be remotely managed by a JMX client such as JConsole; Camel JMX RMI connector server can be optionally turned on by setting system property and the <code>MBeanServer</code> used by Camel is attached to that connector server.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h4 id="CamelJMX-CreatingJMXRMIConnectorServer">Creating JMX RMI Connector Server</h4><p>JMX connector server enables MBeans to be remotely managed by a JMX client such as JConsole; Camel JMX RMI connector server can be optionally turned on by setting system property and the <strong><code>MBeanServer</code></strong> used by Camel is attached to that connector server.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[-Dorg.apache.camel.jmx.createRmiConnector=True ]]></script> -</div></div><p>Or, by adding a <strong>jmxAgent</strong> element inside the <code>camelContext</code> element in Spring configuration:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>Or, by adding a <strong><code>jmxAgent</code></strong> element inside the <strong><code>camelContext</code></strong> element in Spring configuration:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> <jmxAgent id="agent" createConnector="true"/> ... @@ -138,25 +138,25 @@ camel.disableJMX(); </div></div><h4 id="CamelJMX-JMXServiceURL">JMX Service URL</h4><p>The default JMX Service URL has the format:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[service:jmx:rmi:///jndi/rmi://localhost:<registryPort>/<serviceUrlPath> ]]></script> -</div></div><p><em>registryPort</em> is the RMI registry port and the default value is <strong>1099</strong>.</p><p>You can set the RMI registry port by system property.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>where <strong><code>registryPort</code></strong> is the RMI registry port and the default value is <strong><code>1099</code></strong>.</p><p>You can set the RMI registry port by system property.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[-Dorg.apache.camel.jmx.rmiConnector.registryPort=<port number> ]]></script> -</div></div><p>Or, by adding a <strong>jmxAgent</strong> element inside the camelContext element in Spring configuration:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>Or, by adding a <strong><code>jmxAgent</code></strong> element inside the <strong><code>camelContext</code></strong> element in Spring configuration:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> <jmxAgent id="agent" createConnector="true" registryPort="port number"/> ... </camelContext> ]]></script> -</div></div><p><em>serviceUrlPath</em> is the path name in the URL and the default value is <strong>/jmxrmi/camel</strong>.</p><p>You can set the service URL path by system property.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>where <strong><code>serviceUrlPath</code></strong> is the path name in the URL and the default value is <strong><code>/jmxrmi/camel</code></strong>.</p><p>You can set the service URL path by system property.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[-Dorg.apache.camel.jmx.serviceUrlPath=<path> ]]></script> -</div></div><div class="confluence-information-macro confluence-information-macro-tip"><p class="title">Setting ManagementAgent settings in Java</p><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p>In <strong>Camel 2.4</strong> onwards you can also set the various options on the <code>ManagementAgent</code>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><div class="confluence-information-macro confluence-information-macro-tip"><p class="title">Setting ManagementAgent settings in Java</p><span class="aui-icon aui-icon-small aui-iconfont-approve confluence-information-macro-icon"></span><div class="confluence-information-macro-body"><p><strong>From Camel 2.4:</strong> various options can also be set on the <strong><code>ManagementAgent</code></strong>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ context.getManagementStrategy().getManagementAgent().setServiceUrlPath("/foo/bar"); context.getManagementStrategy().getManagementAgent().setRegistryPort(2113); context.getManagementStrategy().getManagementAgent().setCreateConnector(true); ]]></script> -</div></div></div></div><p>Or, by adding a <strong>jmxAgent</strong> element inside the camelContext element in Spring configuration:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div></div></div><p>Or, by adding a <strong><code>jmxAgent</code></strong> element inside the <strong><code>camelContext</code></strong> element in Spring configuration:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> <jmxAgent id="agent" createConnector="true" serviceUrlPath="path"/> ... @@ -165,7 +165,7 @@ context.getManagementStrategy().getManag </div></div><p>By default, RMI server object listens on a dynamically generated port, which can be a problem for connections established through a firewall. In such situations, RMI connection port can be explicitly set by the system property.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[-Dorg.apache.camel.jmx.rmiConnector.connectorPort=<port number> ]]></script> -</div></div><p>Or, by adding a <strong>jmxAgent</strong> element inside the <code>camelContext</code> element in Spring configuration:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>Or by adding a <strong><code>jmxAgent</code></strong> element inside the <strong><code>camelContext</code></strong> element in Spring configuration:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring"> <jmxAgent id="agent" createConnector="true" connectorPort="port number"/> ... @@ -174,21 +174,21 @@ context.getManagementStrategy().getManag </div></div><p>When the connector port option is set, the JMX service URL will become:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[service:jmx:rmi://localhost:<connectorPort>/jndi/rmi://localhost:<registryPort>/<serviceUrlPath> ]]></script> -</div></div><h4 id="CamelJMX-TheSystemPropertiesforCamelJMXsupport">The System Properties for Camel JMX support</h4><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Property Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>org.apache.camel.jmx</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>true or false</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>if is true , it will enable jmx feature in Camel</p></td></tr></tbody></table></div><p>See more system properties in this section below: <em>jmxAgent Properties Reference</em></p><h4 id="CamelJMX-HowtouseauthenticationwithJMX">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 t he SUN documentation how to use this:</p><ul class="alternate"><li><a shape="rect" class="external-link" href="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html" rel="nofollow">http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html</a></li><li><a shape="rect" class="external-link" href="http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html" rel="nofollow">http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html</a></li></ul><h4 id="CamelJMX-JMXinsideanApplicationServer">JMX inside an Application Server</h4><h5 id="CamelJMX-Tomcat6">Tomcat 6</h5><p>See <a shape="rect" class="external-link" href="http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html">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 pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h4 id="CamelJMX-SystemPropertiesforCamelJMXSupport">System Properties for Camel JMX Support</h4><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Property Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.jmx</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong><code>true/</code></strong><strong><code>false</code></strong></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>When <strong><code>true</code></strong> JMX in enabled in Camel.</p></td></tr></tbody></table></div><p>See more system properties in this section below: <em>jmxAgent Properties Reference</em></p><h4 id="CamelJMX-HowtouseauthenticationwithJMX">How to use authentication with JMX</h4><p>JMX in the JDK have features for a uthentication and also for using secure connections over SSL. You have to refer to the SUN documentation how to use this:</p><ul class="alternate"><li><a shape="rect" class="external-link" href="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html" rel="nofollow">http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html</a></li><li><a shape="rect" class="external-link" href="http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html" rel="nofollow">http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html</a></li></ul><h4 id="CamelJMX-JMXinsideanApplicationServer">JMX inside an Application Server</h4><h5 id="CamelJMX-Tomcat6">Tomcat 6</h5><p>See <a shape="rect" class="external-link" href="http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html">this page</a> for details about enabling JMX in Tomcat.</p><p>In short, modify your <strong><code>catalina.sh</code></strong> (or <strong><code>catalina.bat</code></strong> in Windows) f ile to set the following options...</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ set CATALINA_OPTS=-Dcom.sun.management.jmxremote \ -Dcom.sun.management.jmxremote.port=1099 \ -Dcom.sun.management.jmxremote.ssl=false \ -Dcom.sun.management.jmxremote.authenticate=false ]]></script> -</div></div><h5 id="CamelJMX-JBossAS4">JBoss AS 4</h5><p>By default JBoss creates its own <code>MBeanServer</code>. To allow Camel to expose to the same server follow these steps:</p><p>1. Tell Camel to use the Platform <code>MBeanServer</code> (This defaults to true in Camel 1.5)</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h5 id="CamelJMX-JBossAS4">JBoss AS 4</h5><p>By default JBoss creates its own <strong><code>MBeanServer</code></strong>. To allow Camel to expose to the same server follow these steps:</p><ul><li>Tell Camel to use the Platform <strong><code>MBeanServer</code></strong> (This defaults to true in Camel 1.5)</li></ul><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<camel:camelContext id="camelContext"> - <camel:jmxAgent id="jmxAgent" mbeanObjectDomainName="org.yourname" usePlatformMBeanServer="true" /> + <camel:jmxAgent id="jmxAgent" mbeanObjectDomainName="org.yourname" usePlatformMBeanServer="true"/> </camel:camelContext> ]]></script> -</div></div><p>2. Alter your JBoss instance to use the Platform <code>MBeanServer</code>.<br clear="none"> Add the following property to your JAVA_OPTS by editing run.sh or run.conf {{ -Djboss.platform.mbeanserver }} See <a shape="rect" class="external-link" href="http://wiki.jboss.org/wiki/JBossMBeansInJConsole" rel="nofollow">http://wiki.jboss.org/wiki/JBossMBeansInJConsole</a></p><h5 id="CamelJMX-WebSphere">WebSphere</h5><p>Alter the <code>mbeanServerDefaultDomain</code> to be "WebSphere"</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><ul><li>Alter your JBoss instance to use the Platform <strong><code>MBeanServer</code></strong>.</li><li>Add the following property to your <strong><code>JAVA_OPTS</code></strong> by editing <strong><code>run.sh</code></strong> or <strong><code>run.conf -Djboss.platform.mbeanserver</code></strong>. See <a shape="rect" class="external-link" href="http://wiki.jboss.org/wiki/JBossMBeansInJConsole" rel="nofollow">http://wiki.jboss.org/wiki/JBossMBeansInJConsole</a></li></ul><h5 id="CamelJMX-WebSphere">WebSphere</h5><p>Alter the <strong><code>mbeanServerDefaultDomain</code></strong> to be <strong><code>WebSphere</code></strong></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<camel:jmxAgent id="agent" createConnector="true" mbeanObjectDomainName="org.yourname" usePlatformMBeanServer="false" mbeanServerDefaultDomain="WebSphere"/> ]]></script> -</div></div><h5 id="CamelJMX-OracleOC4j">Oracle OC4j</h5><p>The Oracle OC4J J2EE application server will not allow Camel to access the platform <code>MBeanServer</code>. You can identify this in the log as Camel will log a <code>WARNING</code>.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h5 id="CamelJMX-OracleOC4j">Oracle OC4j</h5><p>The Oracle OC4J J2EE application server will not allow Camel to access the platform <strong><code>MBeanServer</code></strong>. You can identify this in the log as Camel will log a <strong><code>WARN</code></strong>.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[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 @@ -207,7 +207,7 @@ java.lang.SecurityException: Unauthorize <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[SUNJMX=-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=1616 \ -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false ]]></script> -</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 id="CamelJMX-jmxAgentPropertiesReference">jmxAgent Properties Reference</h4><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Spring property</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>System property</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>id</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The JMX agent name, and it is not optional</p></td></tr><tr> <td colspan="1" rowspan="1" class="confluenceTd"><p><code>usePlatformMBeanServer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.jmx.usePlatformMBeanServer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code>, <code>true</code> - Release 1.5 or later</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If <code>true</code>, it will use the <code>MBeanServer</code> from the JVM</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>mbeanServerDefaultDomain</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.jmx.mbeanServerDefaultDomain</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The default JMX domain of the <code>MBeanServer</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>mbeanObjectDomainName</code>< /p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.jmx.mbeanObjectDomainName</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The JMX domain that all object names will use</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>createConnector</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.jmx.createRmiConnect</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If we should create a JMX connector (to allow remote management) for the <code>MBeanServer</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>registryPort</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.jmx.rmiConnector.registryPort</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>1099</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The port that the JMX RMI registry will use</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>connectorPort</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.jmx.rmiConnector.connectorPort</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>-1 (dynamic)</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The port that the JMX RMI server will use</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>serviceUrlPath</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.jmx.serviceUrlPath</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>/jmxrmi/camel</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The path that JMX connector will be registered under</p></td></tr><tr><td colspan="1" rowspan= "1" class="confluenceTd"><p><code>onlyRegisterProcessorWithCustomId</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.jmx.onlyRegisterProcessorWithCustomId</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.0:</strong> 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.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>statisticsLevel</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>All / Default</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.1:</strong> 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. From <strong>Camel 2.16</strong> onwards the All option is renamed to Default, and a new Extended option has been introduced which allows gathered additional runtime JMX metrics.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>includeHostName</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.jmx.includeHostName</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.13:</strong> Whether to include the hostname in the MBean naming. From Camel 2.13 onwards this is default <code>false</code>, where as in older releases its default <code>true</code>. You can use this option to restore old behavior if really needed.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>useHostIPAddress</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>org.apache. camel.jmx.useHostIPAddress</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.16:</strong> Whether to use hostname or IP Address in the service url when creating the remote connector. By default the hostname will be used.</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>loadStatisticsEnabled</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>org.apache.camel.jmx.loadStatisticsEnabled</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>false</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.16:</strong>Whether load statistics is enabled (gathers load statistics using a background thread per CamelContext).</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><code>endpointRuntimeStatisticsEnabled</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>org.apache.camel.jmx.endpointRuntimeStatisticsE nabled</code></td><td colspan="1" rowspan="1" class="confluenceTd"><code>true</code></td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.16:</strong> Whether endpoint runtime statistics is enabled (gathers runtime usage of each incoming and outgoing endpoints).</td></tr></tbody></table></div><h4 id="CamelJMX-ConfiguringwhethertoregisterMBeansalways,fornewroutesorjustbydefault">Configuring whether to register MBeans always, for new routes or just by default</h4><p><strong>Available as of Camel 2.7</strong></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 colspan="1" rowspan="1" class="confluenceTh"><p>Option</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>registerAlways</code></p></td><td colspan="1" r owspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If enabled then MBeans is always registered.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>registerNewRoutes</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If enabled then adding new routes after <a shape="rect" href="camelcontext.html">CamelContext</a> has been started will also register MBeans from that given route.</p></td></tr></tbody></table></div><p>By default Camel registers MBeans for all the routes configured when its starting. The <code>registerNewRoutes</code> 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 <code>registerAlways</code> option when using dynamic <a shape="rect" href="eip.html">EIP</a> patterns such as the <a shape="rect" href="recipient-list.html">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 consumes memory.</p><h3 id="CamelJMX-MonitoringCamelusingJMX">Monitoring Camel using JMX</h3><h4 id="CamelJMX-UsingJConsoletomonitorCamel">Using JConsole to monitor Camel</h4><p>The <code>CamelContext</code> 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 with JConsole</p><p><span class="confluence-embedde d-file-wrapper"><img class="confluence-embedded-image confluence-content-image-border" src="camel-jmx.data/camel-jmx.png" data-image-src="/confluence/download/attachments/85697/camel-jmx.png?version=1&modificationDate=1224680681000&api=v2" data-unresolved-comment-count="0" data-linked-resource-id="9224" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="camel-jmx.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="85697" data-linked-resource-container-version="80"></span></p><h4 id="CamelJMX-Whichendpointsareregistered">Which endpoints are registered</h4><p>In <strong>Camel 2.1</strong> onwards <strong>only</strong> <code>singleton</code> 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 shape="rect" href="recipien t-list.html">Recipient List</a> EIP or from a <code>ProducerTemplate</code> that sends a lot of messages.</p><h4 id="CamelJMX-Whichprocessorsareregistered">Which processors are registered</h4><p>See <a shape="rect" href="why-is-my-processor-not-showing-up-in-jconsole.html">this FAQ</a>.</p><h4 id="CamelJMX-HowtousetheJMXNotificationListenertolistenthecamelevents?">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 <strong>Camel 2.4</strong> you can use a custom JMX NotificationListener to listen the camel events.<br clear="none"> First you need to set up a JmxNotificationEventNotifier before you start the CamelContext.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>(The <strong><code>SUNJMX</code></strong> 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 id="CamelJMX-jmxAgentPropertiesReference">jmxAgent Properties Reference</h4><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Spring property</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>System property</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>id</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The JMX agent name, and i t is not optional.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>usePlatformMBeanServer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.jmx.usePlatformMBeanServer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code>, <code>true</code> - Release 1.5 or later</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If <code>true</code>, it will use the <strong><code>MBeanServer</code></strong> from the JVM.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>mbeanServerDefaultDomain</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.jmx.mbeanServerDefaultDomain</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The default JMX domain of the <strong><code>MBeanServer</code></strong>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>mbeanObjectDomainName</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.jmx.mbeanObjectDomainName</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The JMX domain that all object names will use.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>createConnector</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.jmx.createRmiConnect</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If we should create a JMX connector (to allow remote management) for the <strong><code>MBeanServer</code></strong>.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>registryPort</code></p></td><td colspan="1" rowspan="1" class="confluence Td"><p><code>org.apache.camel.jmx.rmiConnector.registryPort</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>1099</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The port that the JMX RMI registry will use.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>connectorPort</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.jmx.rmiConnector.connectorPort</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>-1 (dynamic)</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The port that the JMX RMI server will use.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>serviceUrlPath</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.jmx.serviceUrlPath</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>/jmxrmi/camel</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>T he path that JMX connector will be registered under.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>onlyRegisterProcessorWithCustomId</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.jmx.onlyRegisterProcessorWithCustomId</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.0:</strong> 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.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>statisticsLevel</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>All / Default</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.1:</strong> Configures the level for whether per formance statistics is enabled for the MBean. See section <em>Configuring level of granularity for performance statistics</em> for more details. </p><p><strong>From Camel 2.16</strong>: the <strong><code>All</code></strong> option is renamed to <strong><code>Default</code></strong>, and a new <strong><code>Extended</code></strong> option has been introduced which allows gathered additional run time JMX metrics.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>includeHostName</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.jmx.includeHostName</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.13:</strong> Whether to include the hostname in the MBean naming. <strong>From Camel 2.13</strong>: the default is <strong><code>false</code></strong>. Previously the default was <strong><code>true</code></strong>.</p><p> You can use this option to restore old behavior if really needed.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>useHostIPAddress</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.jmx.useHostIPAddress</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.16:</strong> Whether to use hostname or IP Address in the service url when creating the remote connector. By default the hostname will be used.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>loadStatisticsEnabled</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.jmx.loadStatisticsEnabled</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.16:</strong>Whether load statistics is enabled (gathers load statistics using a background thread per CamelContext).</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>endpointRuntimeStatisticsEnabled</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>org.apache.camel.jmx.endpointRuntimeStatisticsEnabled</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.16:</strong> Whether endpoint runtime statistics is enabled (gathers runtime usage of each incoming and outgoing endpoints).</p></td></tr></tbody></table></div><h4 id="CamelJMX-ConfiguringWhethertoRegisterMBeansalways,ForNewRoutesorJustbyDefault">Configuring Whether to Register MBeans always, For New Routes or Just by Default</h4><p><strong>Available as of Camel 2.7</strong></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 c olspan="1" rowspan="1" class="confluenceTh"><p>Option</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>registerAlways</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>false</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If enabled then MBeans is always registered.</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>registerNewRoutes</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>true</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If enabled then adding new routes after <a shape="rect" href="camelcontext.html">CamelContext</a> has been started will also register MBeans from that given route.</p></td></tr></tbody></table></div><p>By default Camel registers MBeans for all the routes configured when its starting. The <strong><code>registerNewRoutes</code></strong> 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 <strong><code>registerAlways</code></strong> option when using dynamic <a shape="rect" href="eip.html">EIP</a> patterns such as the <a shape="rect" href="recipient-list.html">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 degradation in system performance due the rising number of mbeans in the registry. A MBean is not a light-weight object and thus consumes memory.</p><h3 id="CamelJMX-MonitoringCamelusingJMX">Monitoring Camel using JMX</h3><h4 id="CamelJMX-UsingJConsoletomonitorCamel">Using JConsole to monitor Camel</h4><p>The <strong><code>CamelContext</code></strong> should appear in the l ist of local connections, if you are running JConsole on the same host as Camel.  To connect to a remote Camel instance, or if the local process does not show up, use Remote Process option, and enter an URL.</p><p>Here is an example localhost URL: <strong><code>service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi/camel</code></strong></p><p>Using the Apache Camel with JConsole</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-content-image-border" src="camel-jmx.data/camel-jmx.png" data-image-src="/confluence/download/attachments/85697/camel-jmx.png?version=1&modificationDate=1224680681000&api=v2" data-unresolved-comment-count="0" data-linked-resource-id="9224" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="camel-jmx.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="85 697" data-linked-resource-container-version="81"></span></p><h4 id="CamelJMX-Whichendpointsareregistered">Which endpoints are registered</h4><p>In <strong>Camel 2.1</strong> onward <strong>only</strong> <code>singleton</code> 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 shape="rect" href="recipient-list.html">Recipient List</a> EIP or from a <strong><code>ProducerTemplate</code></strong> that sends a lot of messages.</p><h4 id="CamelJMX-Whichprocessorsareregistered">Which processors are registered</h4><p>See <a shape="rect" href="why-is-my-processor-not-showing-up-in-jconsole.html">this FAQ</a>.</p><h4 id="CamelJMX-HowtousetheJMXNotificationListenertolistenthecamelevents?">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. From <strong>Camel 2.4</strong> you can use a custom JMX NotificationListener to listen the camel events.</p><p>First you need to set up a <strong><code>JmxNotificationEventNotifier</code></strong> before you start the CamelContext.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ // Set up the JmxNotificationEventNotifier notifier = new JmxNotificationEventNotifier(); @@ -236,7 +236,7 @@ context.getManagementStrategy().getManag }, null); ]]></script> -</div></div><h4 id="CamelJMX-UsingtheTracerMBeantogetfinegrainedtracing">Using the Tracer MBean to get fine grained tracing</h4><p>Additionally to the coarse grained notifications above <strong>Camel 2.9.0</strong> support JMX Notification for fine grained trace events.<br clear="none"> 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 clear="none"> 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 <code>jmxTraceNotifications</code> attribute to <code>true</code> 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="confluence-embedded-file-wrapper"><img class="c onfluence-embedded-image confluence-content-image-border" src="camel-jmx.data/jconsole_trace_notifications.png" data-image-src="/confluence/download/attachments/85697/jconsole_trace_notifications.png?version=1&modificationDate=1317961747000&api=v2" data-unresolved-comment-count="0" data-linked-resource-id="28016788" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="jconsole_trace_notifications.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="85697" data-linked-resource-container-version="80"></span></p><h3 id="CamelJMX-UsingJMXforyourownCamelCode">Using JMX for your own Camel Code</h3><h4 id="CamelJMX-RegisteringyourownManagedEndpoints">Registering your own Managed Endpoints</h4><p><strong>Available as of Camel 2.0</strong><br clear="none"> You can decorate your own endpoints with Spring managed annotations <code>@ManagedResource< /code> to allow to register them in the Camel <code>MBeanServer</code> and thus access your custom MBeans using JMX.<br clear="none"> <strong>Notice:</strong> in <strong>Camel 2.1</strong> we have changed this to apply other than just endpoints but then you need to implement the interface <code>org.apache.camel.spi.ManagementAware</code> 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 pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><h4 id="CamelJMX-UsingtheTracerMBeantogetfinegrainedtracing">Using the Tracer MBean to get fine grained tracing</h4><p>Additionally to the coarse grained notifications above <strong>Camel 2.9.0</strong> support JMX Notification for fine grained trace events. 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. 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 <strong><code>jmxTraceNotifications</code></strong> attribute to <code>true</code> on the tracer. This can again be done when configuring the context or at run time on the tracer MBean.</p><p>Now you can register for <code>TraceEvent</code> 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="confluence-embedded-file-wrapper"><img class= "confluence-embedded-image confluence-content-image-border" src="camel-jmx.data/jconsole_trace_notifications.png" data-image-src="/confluence/download/attachments/85697/jconsole_trace_notifications.png?version=1&modificationDate=1317961747000&api=v2" data-unresolved-comment-count="0" data-linked-resource-id="28016788" data-linked-resource-version="1" data-linked-resource-type="attachment" data-linked-resource-default-alias="jconsole_trace_notifications.png" data-base-url="https://cwiki.apache.org/confluence" data-linked-resource-content-type="image/png" data-linked-resource-container-id="85697" data-linked-resource-container-version="81"></span></p><h3 id="CamelJMX-UsingJMXforyourownCamelCode">Using JMX for your own Camel Code</h3><h4 id="CamelJMX-RegisteringyourownManagedEndpoints">Registering your own Managed Endpoints</h4><p><strong>Available as of Camel 2.0</strong><br clear="none"> You can decorate your own endpoints with Spring managed annotations <strong><code>@Manage dResource</code></strong> to allow to register them in the Camel <strong><code>MBeanServer</code></strong> and thus access your custom MBeans using JMX.<br clear="none"> <strong>Notice:</strong> in <strong>Camel 2.1</strong> we have changed this to apply other than just endpoints but then you need to implement the interface <strong><code>org.apache.camel.spi.ManagementAware</code></strong> 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 pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[ @ManagedResource(description = "Our custom managed endpoint") public class CustomEndpoint extends MockEndpoint implements ManagementAware<CustomEndpoint> { @@ -268,61 +268,61 @@ public class CustomEndpoint extends Mock } } ]]></script> -</div></div>Notice from <strong>Camel 2.9</strong> onwards its encouraged to use the <code>@ManagedResource</code>, <code>@ManagedAttribute</code>, and <code>@ManagedOperation</code> from the <code>org.apache.camel.api.management</code> package. This allows your custom code to not depend on Spring JARs.<h4 id="CamelJMX-ProgrammingyourownManagedServices">Programming your own Managed Services</h4><p><strong>Available as of Camel 2.1</strong></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 <code>org.apache.camel.spi.ManagementAware</code> 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 y ou can use to export management on an existing bean. That means that you often use that and just return <code>this</code> in the <code>getManagedObject</code> from the <code>ManagementAware</code> interface. For an example see the code example above with the <code>CustomEndpoint</code>.</p><p>Now in <strong>Camel 2.1</strong> 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 <code>ManagementAware</code> 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 colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>MBean wrapper</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>CamelContext</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>ManagedCamelContext</p></td></tr><tr><td colspan= "1" rowspan="1" class="confluenceTd"><p>Component</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>ManagedComponent</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Endpoint</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>ManagedEndpoint</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Consumer</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>ManagedConsumer</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Producer</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>ManagedProducer</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Route</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>ManagedRoute</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Processor</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>ManagedProcessor</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Tracer</p></td><td colspan="1" rows pan="1" class="confluenceTd"><p>ManagedTracer</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Service</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>ManagedService</p></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 colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>MBean wrapper</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>ScheduledPollConsumer</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>ManagedScheduledPollConsumer</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>BrowsableEndpoint</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>ManagedBrowseableEndpoint</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Throttler</p></td><td colspan="1" rowspan="1" class="con fluenceTd"><p>ManagedThrottler</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>Delayer</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>ManagedDelayer</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>SendProcessor</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>ManagedSendProcessor</p></td></tr></tbody></table></div><p>And in the future we will add additional wrappers for more EIP patterns.</p><h4 id="CamelJMX-ManagementNamingStrategy">ManagementNamingStrategy</h4><p><strong>Available as of Camel 2.1</strong></p><p>Camel provides a pluggable API for naming strategy by <code>org.apache.camel.spi.ManagementNamingStrategy</code>. A default implementation is used to compute the MBean names that all MBeans are registered with.</p><h4 id="CamelJMX-Managementnamingpattern">Management naming pattern</h4><p><strong>Available as of Camel 2.10</strong></p><p>From <strong>Camel 2.10</strong> onwards we made it easier to configure a naming pattern for the MBeans. The pattern is used as part of the <code>ObjectName</code> as they key after the domain name.</p><p>By default Camel will use MBean names for the <code>ManagedCamelContextMBean</code> as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><strong>From Camel 2.9:</strong> it's encouraged that you use the <strong><code>@ManagedResource</code></strong>, <strong><code>@ManagedAttribute</code></strong>, and <strong><code>@ManagedOperation</code></strong> attributes from the <strong><code>org.apache.camel.api.management</code></strong> package. This allows your custom code to not depend on Spring JARs.<h4 id="CamelJMX-ProgrammingyourownManagedServices">Programming your own Managed Services</h4><p><strong>Available as of Camel 2.1</strong></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 <strong><code>org.apache.camel.spi.ManagementAware</code></strong> 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 yea h 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 <code>this</code> in the <strong><code>getManagedObject</code></strong> from the <strong><code>ManagementAware</code></strong> interface. For an example see the code example above with the <strong><code>CustomEndpoint</code></strong>.</p><p>Now in <strong>Camel 2.1</strong> 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 <strong><code>ManagementAware</code></strong> 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 colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>MBean wrapper</p></th></tr><tr><td colspan="1" r owspan="1" class="confluenceTd"><p><code>CamelContext</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ManagedCamelContext</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Component</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ManagedComponent</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Endpoint</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ManagedEndpoint</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Consumer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ManagedConsumer</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Producer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ManagedProducer</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Route</code></p></td><td colspan="1" rowspan=" 1" class="confluenceTd"><p><code>ManagedRoute</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Processor</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ManagedProcessor</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Tracer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ManagedTracer</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Service</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ManagedService</code></p></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 colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>MBean wrapper</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ScheduledPol lConsumer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ManagedScheduledPollConsumer</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>BrowsableEndpoint</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ManagedBrowseableEndpoint</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Throttler</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ManagedThrottler</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>Delayer</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ManagedDelayer</code></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><code>SendProcessor</code></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><code>ManagedSendProcessor</code></p></td></tr></tbody></table></div><p>And in the future we will add additional wrappers for more EIP patterns.</p><h4 id="CamelJM X-ManagementNamingStrategy">ManagementNamingStrategy</h4><p><strong>Available as of Camel 2.1</strong></p><p>Camel provides a pluggable API for naming strategy by <strong><code>org.apache.camel.spi.ManagementNamingStrategy</code></strong>. A default implementation is used to compute the MBean names that all MBeans are registered with.</p><h4 id="CamelJMX-Managementnamingpattern">Management naming pattern</h4><p><strong>Available as of Camel 2.10</strong></p><p><strong>From</strong> <strong>Camel 2.10</strong>: we made it easier to configure a naming pattern for the MBeans. The pattern is used as part of the <strong><code>ObjectName</code></strong> as they key after the domain name. By default Camel will use MBean names for the <strong><code>ManagedCamelContextMBean</code></strong> as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[org.apache.camel:context=localhost/camel-1,type=context,name=camel-1 ]]></script> -</div></div><p>And from <strong>Camel 2.13</strong> onwards the hostname is not included in the MBean names, so the above example would be as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p><strong>From Camel 2.13:</strong> the <strong><code>hostname</code></strong> is not included in the MBean names, so the above example would be as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[org.apache.camel:context=camel-1,type=context,name=camel-1 ]]></script> -</div></div><p>If you configure a name on the <code>CamelContext</code> then that name is part of the <code>ObjectName</code> as well. For example if we have</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>If you configure a name on the <strong><code>CamelContext</code></strong> then that name is part of the <strong><code>ObjectName</code></strong> as well. For example if we have</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<camelContext id="myCamel" ...> ]]></script> </div></div><p>Then the MBean names will be as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[org.apache.camel:context=localhost/myCamel,type=context,name=myCamel ]]></script> -</div></div><p>Now if there is a naming clash in the JVM, such as there already exists a MBean with that given name above, then Camel will by default try to auto correct this by finding a new free name in the <code>JMXMBeanServer</code> by using a counter. As shown below the counter is now appended, so we have <code>myCamel-1</code> as part of the <code>ObjectName</code>:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>Now if there is a naming clash in the JVM, such as there already exists a MBean with that given name above, then Camel will by default try to auto correct this by finding a new free name in the <strong><code>JMXMBeanServer</code></strong> by using a counter. As shown below the counter is now appended, so we have <strong><code>myCamel-1</code></strong> as part of the <strong><code>ObjectName</code>:</strong></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[org.apache.camel:context=localhost/myCamel-1,type=context,name=myCamel ]]></script> -</div></div><p>This is possible because Camel uses a naming pattern by default that supports the following tokens</p><ul class="alternate"><li>#camelId# = the CamelContext id (eg the name)</li><li>#name# - same as #camelId#</li><li>#counter# - an incrementing counter</li><li>#bundleId# - the OSGi bundle id (only for OSGi environments)</li><li>#symbolicName# - the OSGi symbolic name (only for OSGi environments)</li><li>#version# - the OSGi bundle version (only for OSGi environments)</li></ul><p>The default naming pattern is differentiated between OSGi and non-OSGi as follows:</p><ul class="alternate"><li>non OSGI: #name#</li><li>OSGi: #bundleId#-#name#</li><li>OSGi <strong>Camel 2.13:</strong> #symbolicName#</li></ul><p>However if there is a naming clash in the <code>JMXMBeanServer</code> then Camel will automatic fallback and use the #counter# in the pattern to remedy this. And thus the following patterns will then be used:</p><ul class="alternate"><li>non OSGI: #name#-#counter#</li ><li>OSGi: #bundleId#-#name#-#counter#</li><li>OSGi <strong>Camel >2.13:</strong> #symbolicName#-#counter#</li></ul><p>If you set an explicit >naming pattern, then that pattern is always used, and the default patterns >above is <strong>not</strong> used.<br clear="none"> This allows us to have >full control, very easily, of the naming for both the ><code>CamelContext</code> id in the <a shape="rect" >href="registry.html">Registry</a> as well the JMX MBeans in the ><code>JMXMBeanRegistry</code>.</p><p>From <strong>Camel 2.15</strong> >onwards you can configure the default management name pattern using a JVM >system property, to configure this globally for the JVM. Notice that you can >override this pattern by configure it explicit, as shown in the examples >further below.</p><p>Set a JVM system property to use a default management >name pattern that prefixes the name with cool.</p><div class="code panel pdl" >style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>This is possible because Camel uses a naming pattern by default that supports the following tokens</p><ul class="alternate"><li><code>#camelId#</code> = the CamelContext id (eg the name)</li><li><code>#name#</code> - same as #camelId#</li><li><code>#counter#</code> - an incrementing counter</li><li><code>#bundleId#</code> - the OSGi bundle id (only for OSGi environments)</li><li><code>#symbolicName#</code> - the OSGi symbolic name (only for OSGi environments)</li><li><code>#version#</code> - the OSGi bundle version (only for OSGi environments)</li></ul><p>The default naming pattern is differentiated between OSGi and non-OSGi as follows:</p><ul class="alternate"><li>non OSGI: <code>#name#</code></li><li>OSGi: <code>#bundleId#-#name#</code></li><li>OSGi <strong>Camel 2.13:</strong> <code>#symbolicName#</code></li></ul><p>However if there is a naming clash in the <strong><code>JMXMBeanServer</code></strong> then Camel will automatic fallback and use the #c ounter# in the pattern to remedy this. And thus the following patterns will then be used:</p><ul class="alternate"><li>non OSGI: <code>#name#-#counter#</code></li><li>OSGi: <code>#bundleId#-#name#-#counter#</code></li><li>OSGi <strong>Camel 2.13:</strong> <code>#symbolicName#-#counter#</code></li></ul><p>If you set an explicit naming pattern, then that pattern is always used, and the default patterns above is <strong>not</strong> used. This allows us to have full control, very easily, of the naming for both the <strong><code>CamelContext</code></strong> id in the <a shape="rect" href="registry.html">Registry</a> as well the JMX MBeans in the <strong><code>JMXMBeanRegistry</code></strong>.</p><p>From <strong>Camel 2.15</strong> onwards you can configure the default management name pattern using a JVM system property, to configure this globally for the JVM. Notice that you can override this pattern by configure it explicit, as shown in the examples further below.</ p><p>Set a JVM system property to use a default management name pattern that prefixes the name with cool.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[System.setProperty(JmxSystemPropertyKeys.MANAGEMENT_NAME_PATTERN, "cool-#name#");]]></script> -</div></div><p> </p><p>So if we want to explicit name both the <code>CamelContext</code> and to use fixed MBean names, that do not change (eg has no counters), then we can use the new <code>managementNamePattern</code> attribute:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p> </p><p>So if we want to explicit name both the <strong><code>CamelContext</code></strong> and to use fixed MBean names, that do not change e.g., has no counters, then we can use the new <strong><code>managementNamePattern</code></strong> attribute:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<camelContext id="myCamel" managementNamePattern="#name#"> ]]></script> </div></div><p>Then the MBean names will always be as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[org.apache.camel:context=localhost/myCamel,type=context,name=myCamel ]]></script> -</div></div><p>In Java, you can configure the <code>managementNamePattern</code> as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>In Java, you can configure the <strong><code>managementNamePattern</code></strong> as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: java; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[context.getManagementNameStrategy().setNamePattern("#name#"); ]]></script> -</div></div><p>You can also use a different name in the <code>managementNamePattern</code> than the id, so for example we can do:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> +</div></div><p>You can also use a different name in the <strong><code>managementNamePattern</code></strong> than the id, so for example we can do:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<camelContext id="myCamel" managementNamePattern="coolCamel"> ]]></script> </div></div><p>You may want to do this in OSGi environments in case you do not want the OSGi bundle id as part of the MBean names. As the OSGi bundle id can change if you restart the server, or uninstall and install the same application. You can then do as follows to not use the OSGi bundle id as part of the name:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl"> <script class="brush: xml; gutter: false; theme: Default" type="syntaxhighlighter"><![CDATA[<camelContext id="myCamel" managementNamePattern="#name#"> ]]></script> [... 46 lines stripped ...]