JMX ManagementPage edited by David ValeriConfiguring JMX IntegrationTo enable the JMX integration, register an InstrumentationManager extension with the CXF bus. Using Spring XML, the following minimal XML snippet will enable JMX integration. <bean id="org.apache.cxf.management.InstrumentationManager" class="org.apache.cxf.management.jmx.InstrumentationManagerImpl"> <property name="bus" ref="cxf" /> <property name="enabled" value="true" /> </bean>
To avoid any unnecessary runtime overhead, the performance counters measuring response time are disabled by default. Further configuration is required to enable this instrumentation. Example ConfigurationEnable JMX integration by adding the following XML to your CXF Spring context. <bean id="org.apache.cxf.management.InstrumentationManager" class="org.apache.cxf.management.jmx.InstrumentationManagerImpl"> <property name="bus" ref="cxf" /> <property name="enabled" value="true" /> <property name="JMXServiceURL " value="service:jmx:rmi:///jndi/rmi://localhost:9914/jmxrmi" /> </bean> To test the configuration start up your service and connect to it by using jconsole from the JDK. Configuring CXF to Use the ServiceMix 4 MBeanServerIf 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 by 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. <!-- OSGi namespace and schemaLocation required --> <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"> ... <!-- Grab a reference to the current MBeanServer --> <osgi:reference id="mbeanServer" interface="javax.management.MBeanServer" cardinality="0..1"/> <bean id="org.apache.cxf.management.InstrumentationManager" class="org.apache.cxf.management.jmx.InstrumentationManagerImpl"> <property name="bus" ref="cxf" /> <property name="enabled" value="true" /> <!-- Unless you really want to open an additional connector, set this to false --> <property name="createMBServerConnectorFactory " value="false" /> <!-- Inject the reference to the MBeanServer --> <property name="server" ref="mbeanServer" /> </bean> How to Get the Request/Response Handling Time?The CXF management module also provides a feature which can get the aggregate statistics for services running in the CXF Bus. Here is the configuration snippet that you should add to your Spring context file to enable response time collection.
<!-- Wiring the counter repository -->
<bean id="CounterRepository" class="org.apache.cxf.management.counters.CounterRepository">
<property name="bus" ref="cxf" />
</bean>
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.
Change Notification Preferences
View Online
|
View Change
|
Add Comment
|
- [CONF] Apache CXF Documentation > JMX Management confluence
- [CONF] Apache CXF Documentation > JMX Management confluence
- [CONF] Apache CXF Documentation > JMX Management confluence
- [CONF] Apache CXF Documentation > JMX Management confluence
