cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache CXF Documentation > JMX Management
Date Wed, 24 Feb 2010 16:50:00 GMT
<html>
<head>
    <base href="http://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=CXF20DOC&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background-color: white" bgcolor="white">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
     <h2><a href="http://cwiki.apache.org/confluence/display/CXF20DOC/JMX+Management">JMX
Management</a></h2>
     <h4>Page <b>edited</b> by             <a href="http://cwiki.apache.org/confluence/display/~oisin">Oisin
Hurley</a>
    </h4>
     
          <br/>
     <div class="notificationGreySide">
         <h1><a name="JMXManagement-HowtoenabletheCXFinstrumentationManager"></a>How
to enable the CXF instrumentationManager</h1>

<p>CXF Endpoints can be managed with JMX. You simply have add the following configuration
to your cxf.xml which will enable the CXF management module to work.</p>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>&lt;bean id="org.apache.cxf.management.InstrumentationManager"
  class="org.apache.cxf.management.jmx.InstrumentationManagerImpl"&gt;
  &lt;property name="bus" ref="cxf" /&gt;
  &lt;property name="enabled" value="true" /&gt;
  &lt;property name="threaded" value="false" /&gt;
  &lt;property name="daemon" value="false" /&gt;
  &lt;property name="JMXServiceURL" value="service:jmx:rmi:///jndi/rmi://localhost:9914/jmxrmi"
/&gt;
&lt;/bean&gt;
</pre>
</div></div>

<p>To avoid any unnecessary runtime overhead, the performance counters measuring response
time are disabled by default. Further <a href="#JMXManagement-responsetime">configuration</a>
is required to enable this instrumentation.</p>

<p>To test the configuration start up your service and connect to it by using jconsole
from the jdk.<br/>
<img src="/confluence/download/attachments/70534/jconsole_connect2.png" align="absmiddle"
border="0" /><br/>
&nbsp;<br/>
Then you can browse to your endpoint:<br/>
&nbsp;<br/>
<img src="/confluence/download/attachments/70534/jconsole_service_endpoint.png" align="absmiddle"
border="0" /><br/>
&nbsp;<br/>
&nbsp;</p>

<p><a name="JMXManagement-cxfinservicemix"></a></p>
<h1><a name="JMXManagement-ConfiguringCXFtoUsetheServiceMixMBeanServer"></a>Configuring
CXF to Use the ServiceMix MBeanServer</h1>

<p>If you are embedding a CXF service in a ServiceMix container, the configuration is
different. You don't want to start a new MBeanServer, instead you want to use the one that
the ServiceMix container is already running. You can do this by injecting a reference to the
running MBeanServer. Don't forget to add the namespace and schemaLocation to your CXF configuration
file if they are not already present.</p>

<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>&lt;!-- OSGi namespace and schemaLocation required --&gt;
&lt;beans ...
       xmlns:osgi="http://www.springframework.org/schema/osgi"
       ...      
       xsi:schemaLocation="...
       http://www.springframework.org/schema/osgi  http://www.springframework.org/schema/osgi/spring-osgi.xsd"&gt;

...

&lt;!-- Grab a reference to the current MBeanServer --&gt;
&lt;osgi:reference id="mbeanServer" interface="javax.management.MBeanServer" cardinality="0..1"/&gt;

&lt;bean id="org.apache.cxf.management.InstrumentationManager"
  class="org.apache.cxf.management.jmx.InstrumentationManagerImpl"&gt;
  &lt;property name="bus" ref="cxf" /&gt;
  &lt;property name="enabled" value="true" /&gt;
  &lt;property name="threaded" value="false" /&gt;
  &lt;property name="daemon" value="false" /&gt;

  &lt;!-- Inject the reference to the MBeanServer --&gt;
  &lt;property name="server" ref="mbeanServer" /&gt; 
&lt;/bean&gt;
</pre>
</div></div>

<p><a name="JMXManagement-responsetime"></a> </p>
<h1><a name="JMXManagement-Howtogettherequestresponsehandlingtime%3F"></a>How
to get the request response handling time ?</h1>

<p>CXF management module also provides a feature which can get the ongoing message's
response time (the Time that CXF get the response - the Time that CXF get the request), since
we can't store each of the message handling time, we just store the longest response time
in the counter repository which you can use jconsole to look up.</p>

<p>Here is the configuration snippet of the that your should add into the cxf.xml</p>
<div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent
panelContent">
<pre>    &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>
     </div>
     <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;">
            <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
       </div>

       <a href="http://cwiki.apache.org/confluence/display/CXF20DOC/JMX+Management">View
Online</a>
       |
       <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=70534&revisedVersion=8&originalVersion=7">View
Change</a>
              |
       <a href="http://cwiki.apache.org/confluence/display/CXF20DOC/JMX+Management?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message