You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bu...@apache.org on 2020/02/07 16:56:52 UTC

svn commit: r1056232 - in /websites/production/cxf/content: cache/docs.pageCache docs/jmx-management.html

Author: buildbot
Date: Fri Feb  7 16:56:52 2020
New Revision: 1056232

Log:
Production update by buildbot for cxf

Modified:
    websites/production/cxf/content/cache/docs.pageCache
    websites/production/cxf/content/docs/jmx-management.html

Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/cxf/content/docs/jmx-management.html
==============================================================================
--- websites/production/cxf/content/docs/jmx-management.html (original)
+++ websites/production/cxf/content/docs/jmx-management.html Fri Feb  7 16:56:52 2020
@@ -118,12 +118,8 @@ Apache CXF -- JMX Management
          <td height="100%">
            <!-- Content -->
            <div class="wiki-content">
-<div id="ConfluenceContent"><h1 id="JMXManagement-ConfiguringJMXIntegration">Configuring JMX Integration</h1>
-
-<p>To enable JMX integration, register an InstrumentationManager extension with the CXF bus.  Using Spring XML on Tomcat, the following minimal XML snippet will enable JMX integration.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
+<div id="ConfluenceContent"><h1 id="JMXManagement-ConfiguringJMXIntegration">Configuring JMX Integration</h1><p>To enable JMX integration, register an InstrumentationManager extension with the CXF bus. Using Spring XML on Tomcat, the following minimal XML snippet will enable JMX integration.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default">
 &lt;import resource="classpath:META-INF/cxf/cxf.xml"/&gt;
 ...
 
@@ -134,34 +130,16 @@ Apache CXF -- JMX Management
   &lt;property name="usePlatformMBeanServer" value="true" /&gt;
 &lt;/bean&gt;
 </pre>
-</div></div>
-
-<p>The default InstrumentationManager accepts the following configuration options:</p>
-
-<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Name </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Value </p></th><th colspan="1" rowspan="1" class="confluenceTh"><p> Default </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> enabled </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> If the JMX integration should be enabled or not </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> false </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> bus </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The CXF bus instance to register the JMX extension with </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> None </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> server </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> An optional reference to an MBeanServer instance to register MBeans with.  If 
 not supplied, an MBeanServer is resolved using the "usePlatformMBeanServer" and/or "serverName" optoins. </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> None </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> usePlatformMBeanServer </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> If true and no reference to an MBeanServer is supplied, the JMX extension registers MBeans with the platform MBean server. </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> false </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> serverName </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> If supplied, usePlatformMBeanServer is false, and no reference to an MBeanServer is supplied, the JMX extension registers MBeans with the MBean server carrying this name. </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> None </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> createMBServerConnectorFa
 ctory </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> If true, a connector is created on the MBeanServer. </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> true </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> threaded </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Determines if the creation of the MBean connector is performed in this thread or in a separate thread.  Only relevant if createMBServerConnectorFactory is true. </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> false </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> daemon </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> Determines if the MBean connector creation thread is marked as a daemon thread or not.  Only relevant if createMBServerConnectorFactory is true. </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> false </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> JMXServiceURL <
 /p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> The URL of the connector to create on the MBeanServer.    Only relevant if createMBServerConnectorFactory is true. </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> service:jmx:rmi:///jndi/rmi://localhost:9913/jmxrmi </p></td></tr></tbody></table></div>
-
-
-<p>The MBean instrumentation provided by the above configuration will provide generic information about the WSDL supported by the web service as well as web service administration commands.  To see performance metrics of the SOAP call processing, further <a shape="rect" href="jmx-management.html">configuration</a> is required &#8211; these are disabled by default to avoid unnecessary runtime overhead.</p>
-
-<p>If you're using Maven, make sure you have the following dependency added to the pom.xml for the web service provider:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
+</div></div><p>The default InstrumentationManager accepts the following configuration options:</p><div class="table-wrap"><table class="wrapped confluenceTable"><colgroup span="1"><col span="1"><col span="1"><col span="1"></colgroup><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Name</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Value</p></th><th colspan="1" rowspan="1" class="confluenceTh"><p>Default</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>enabled</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If the JMX integration should be enabled or not</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>false</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>bus</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The CXF bus instance to register the JMX extension with</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>None</p></td></tr><tr><td colspan="1" rowspan="1" class="confl
 uenceTd"><p>server</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>An optional reference to an MBeanServer instance to register MBeans with. If not supplied, an MBeanServer is resolved using the "usePlatformMBeanServer" and/or "serverName" options.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>None</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>usePlatformMBeanServer</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If true and no reference to an MBeanServer is supplied, the JMX extension registers MBeans with the platform MBean server.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>false</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>serverName</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If supplied, usePlatformMBeanServer is false, and no reference to an MBeanServer is supplied, the JMX extension registers MBeans with the MBean server carrying this name.</p></td><td colspan
 ="1" rowspan="1" class="confluenceTd"><p>None</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>createMBServerConnectorFactory</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>If true, a connector is created on the MBeanServer.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>true</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>threaded</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Determines if the creation of the MBean connector is performed in this thread or in a separate thread. Only relevant if createMBServerConnectorFactory is true.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>false</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>daemon</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>Determines if the MBean connector creation thread is marked as a daemon thread or not. Only relevant if createMBServerConnectorFactory is true.</p></td><td colspan="1" rowspa
 n="1" class="confluenceTd"><p>false</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>JMXServiceURL</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>The URL of the connector to create on the MBeanServer. Only relevant if createMBServerConnectorFactory is true.</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>service:jmx:rmi:///jndi/rmi://localhost:9913/jmxrmi</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">environment</td><td colspan="1" rowspan="1" class="confluenceTd">This is a map that is used to configure the RMI environment.</td><td colspan="1" rowspan="1" class="confluenceTd">None</td></tr></tbody></table></div><p>The MBean instrumentation provided by the above configuration will provide generic information about the WSDL supported by the web service as well as web service administration commands. To see performance metrics of the SOAP call processing, further <a shape="rect" href="https://cwiki.apache.org/confluence/p
 ages/viewpage.action?pageId=84806267">configuration</a> is required &#8211; these are disabled by default to avoid unnecessary runtime overhead.</p><p>If you're using Maven, make sure you have the following dependency added to the pom.xml for the web service provider:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default">
 &lt;dependency&gt;
     &lt;groupId&gt;org.apache.cxf&lt;/groupId&gt;
     &lt;artifactId&gt;cxf-rt-management&lt;/artifactId&gt;
     &lt;version&gt;${cxf.version}&lt;/version&gt;
 &lt;/dependency&gt;
 </pre>
-</div></div>
-
-
-<h2 id="JMXManagement-ExampleConfiguration">Example Configuration</h2>
-
-<p>Enable JMX integration by adding the following XML to your CXF Spring context.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
+</div></div><h2 id="JMXManagement-ExampleConfiguration">Example Configuration</h2><p>Enable JMX integration by adding the following XML to your CXF Spring context.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default">
 &lt;bean id="org.apache.cxf.management.InstrumentationManager"
   class="org.apache.cxf.management.jmx.InstrumentationManagerImpl"&gt;
   &lt;property name="bus" ref="cxf" /&gt;
@@ -169,12 +147,8 @@ Apache CXF -- JMX Management
   &lt;property name="JMXServiceURL " value="service:jmx:rmi:///jndi/rmi://localhost:9914/jmxrmi" /&gt;
 &lt;/bean&gt;
 </pre>
-</div></div>
-
-<p>Starting from 2.5.2, an equivalent configuration of the above instrumentation manager can be directly made within the bus configuration using the corresponding property names having the "bus.jmx" prefix, as in</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
+</div></div><p>Starting from 2.5.2, an equivalent configuration of the above instrumentation manager can be directly made within the bus configuration using the corresponding property names having the "bus.jmx" prefix, as in</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default">
 &lt;cxf:bus bus="cxf"&gt;
   &lt;cxf:properties&gt;
     &lt;entry key="bus.jmx.enabled" value="true"/&gt;
@@ -183,29 +157,23 @@ Apache CXF -- JMX Management
 &lt;/cxf:bus&gt;
 
 </pre>
-</div></div>
-
-<div class="table-wrap"><table class="confluenceTable"><tbody><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <img class="emoticon emoticon-warning" src="https://cwiki.apache.org/confluence/s/en_GB/5997/6f42626d00e36f53fe51440403446ca61552e2a2.1/_/images/icons/emoticons/warning.png" data-emoticon-name="warning" alt="(warning)"> </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> <strong>Changes in CXF 2.5.x</strong> <br clear="none" class="atl-forced-newline">
-Starting from 2.5.0, if&#160;a MBeanServer is available in the Spring context or as an OSGi server (when running in OSGi), the InstrumentationManger will be automatically enabled and will use that MBeanServer and the CXF MBeans will be registered. Therefore, the instrumentation manager configuration shown above is not needed in such cases. </p></td></tr></tbody></table></div>
-
-
-
-<p>To test the configuration start up your service and connect to it by using JConsole from the JDK.<br clear="none">
-<span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="jmx-management.data/jconsole_connect2.png"></span><br clear="none">
-&#160;<br clear="none">
-Then you can browse to your endpoint:<br clear="none">
-&#160;<br clear="none">
-<span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="jmx-management.data/jconsole_service_endpoint.png"></span><br clear="none">
-&#160;</p>
-
-<p><span class="confluence-anchor-link" id="JMXManagement-cxf_in_servicemix"></span></p>
-
-<h1 id="JMXManagement-ConfiguringCXFtoUsetheServiceMix4MBeanServer">Configuring CXF to Use the ServiceMix 4 MBeanServer</h1>
-
-<p>If you are embedding a CXF service in a ServiceMix 4 container, the configuration is slightly different from above. You don't want to start a new MBeanServer and you probably don't want to create additional connectors as the container manages both of these for you.  You can get a reference to the container's MBeanServer through the OSGi framework and inject this reference into the JMX integration extension. Don't forget to add the Spring OSGI namespace and schemaLocation to your CXF configuration file if they are not already present.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
+</div></div><div class="table-wrap"><table class="wrapped confluenceTable"><colgroup span="1"><col span="1"><col span="1"></colgroup><tbody><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><img class="emoticon emoticon-warning" src="https://cwiki.apache.org/confluence/s/-7iq2vk/8301/13280cd41a592ca5883bbc1ae415b58671505365/_/images/icons/emoticons/warning.svg" data-emoticon-name="warning" alt="(warning)"></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><strong>Changes in CXF 2.5.x</strong> <br clear="none" class="atl-forced-newline">Starting from 2.5.0, if&#160;a MBeanServer is available in the Spring context or as an OSGi server (when running in OSGi), the InstrumentationManger will be automatically enabled and will use that MBeanServer and the CXF MBeans will be registered. Therefore, the instrumentation manager configuration shown above is not needed in such cases.</p></td></tr></tbody></table></div><p>To test the configuration start up your service and connect
  to it by using JConsole from the JDK.<br clear="none"><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="jmx-management.data/jconsole_connect2.png"></span><br clear="none">&#160;<br clear="none">Then you can browse to your endpoint:<br clear="none">&#160;<br clear="none"><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image" src="jmx-management.data/jconsole_service_endpoint.png"></span><br clear="none">&#160;</p><p><span class="confluence-anchor-link" id="JMXManagement-cxf_in_servicemix"></span></p><h1 id="JMXManagement-Securingremoteaccess">Securing remote access</h1><p>Starting from CXF 3.3.6, it is possible to secure remote access to the RMI Connector via the "environment" variable. Here is an example:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default">&lt;bean id="org.apache.cxf.management.InstrumentationManager" class="org.apache.cxf.management.jmx.InstrumentationManagerImpl" init-method="init"&gt;
+    &lt;property name="enabled" value="true"/&gt;
+    &lt;property name="bus" ref="cxf"/&gt;
+    &lt;property name="JMXServiceURL" value="service:jmx:rmi:///jndi/rmi://localhost:9914/jmxrmi" /&gt;
+    &lt;property name="environment"&gt;
+        &lt;map xmlns="http://www.springframework.org/schema/beans"&gt;
+            &lt;entry xmlns="http://www.springframework.org/schema/beans"
+                key="jmx.remote.x.password.file" value="./target/classes/jmx.password"/&gt;
+            &lt;entry xmlns="http://www.springframework.org/schema/beans"
+                key="jmx.remote.x.access.file" value="./target/classes/jmx.access"/&gt;
+        &lt;/map&gt;
+    &lt;/property&gt;
+&lt;/bean&gt;
+</pre>
+</div></div><p>where jmx.password and jmx.access contain something like:</p><ul><li>jmx.password: admin cxf</li><li>jmx.access: admin readwrite</li></ul><h1 id="JMXManagement-ConfiguringCXFtoUsetheServiceMix4MBeanServer">Configuring CXF to Use the ServiceMix 4 MBeanServer</h1><p>If you are embedding a CXF service in a ServiceMix 4 container, the configuration is slightly different from above. You don't want to start a new MBeanServer and you probably don't want to create additional connectors as the container manages both of these for you. You can get a reference to the container's MBeanServer through the OSGi framework and inject this reference into the JMX integration extension. Don't forget to add the Spring OSGI namespace and schemaLocation to your CXF configuration file if they are not already present.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default">
 &lt;!-- OSGi namespace and schemaLocation required --&gt;
 &lt;beans ...
        xmlns:osgi="http://www.springframework.org/schema/osgi"
@@ -229,26 +197,14 @@ Then you can browse to your endpoint:<br
   &lt;property name="server" ref="mbeanServer" /&gt;
 &lt;/bean&gt;
 </pre>
-</div></div>
-
-<p><span class="confluence-anchor-link" id="JMXManagement-response_time"></span></p>
-
-<h1 id="JMXManagement-Howtogetwebserviceperformancemetrics(Request/Responsetime,numberofcalls,etc.)?">How to get web service performance metrics (Request/Response time, number of calls, etc.)?</h1>
-
-<p>The CXF management module also provides a feature (the Performance.Counter.Server MBean) which provides aggregate statistics for services running in the CXF Bus.  It is not enabled by default to avoid unnecessary runtime overhead during web service call processing.</p>
-
-<p>Here is the configuration snippet that you should add to your Spring context file to be able to view this information:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">
+</div></div><p><span class="confluence-anchor-link" id="JMXManagement-response_time"></span></p><h1 id="JMXManagement-Howtogetwebserviceperformancemetrics(Request/Responsetime,numberofcalls,etc.)?">How to get web service performance metrics (Request/Response time, number of calls, etc.)?</h1><p>The CXF management module also provides a feature (the Performance.Counter.Server MBean) which provides aggregate statistics for services running in the CXF Bus. It is not enabled by default to avoid unnecessary runtime overhead during web service call processing.</p><p>Here is the configuration snippet that you should add to your Spring context file to be able to view this information:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default">
     &lt;!-- Wiring the counter repository --&gt;
     &lt;bean id="CounterRepository" class="org.apache.cxf.management.counters.CounterRepository"&gt;
         &lt;property name="bus" ref="cxf" /&gt;
     &lt;/bean&gt;
 </pre>
-</div></div>
-
-<p>The CounterRepository collects the following metrics: invocations, checked application faults, unchecked application faults, runtime faults, logical runtime faults, total handling time, max handling time, and min handling time.  Note a SOAP call will need to occur against the web service before you will see the MBean within your JMX monitoring software.</p></div>
+</div></div><p>The CounterRepository collects the following metrics: invocations, checked application faults, unchecked application faults, runtime faults, logical runtime faults, total handling time, max handling time, and min handling time. Note a SOAP call will need to occur against the web service before you will see the MBean within your JMX monitoring software.</p></div>
            </div>
            <!-- Content -->
          </td>