...
Name | Value | Default |
---|---|---|
enabled | If the JMX integration should be enabled or not | false |
bus | The CXF bus instance to register the JMX extension with | None |
server | 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. | None |
usePlatformMBeanServer | If true and no reference to an MBeanServer is supplied, the JMX extension registers MBeans with the platform MBean server. | false |
serverName | 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. | None |
Before CXF 3.4.0, the following options were also available. From CXF 3.4.0, these options are removed, as there is no real advantage to creating a custom JMX local Connector. Local JMX monitoring can be done using standard tools, and remote JMX monitoring is done using the standard JVM JXM options (see below).
Name | Value | Default |
---|---|---|
createMBServerConnectorFactory deprecated | If true, a connector is created on the MBeanServer. | true |
threaded deprecated | Determines if the creation of the MBean connector is performed in this thread or in a separate thread. Only relevant if createMBServerConnectorFactory is true. | false |
daemon deprecated | Determines if the MBean connector creation thread is marked as a daemon thread or not. Only relevant if createMBServerConnectorFactory is true. | false |
JMXServiceURL deprecated | The URL of the connector to create on the MBeanServer. Only relevant if createMBServerConnectorFactory is true. | service:jmx:rmi:///jndi/rmi://localhost:9913/jmxrmi |
environment deprecated | This is a map that is used to configure the RMI environment. | None |
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 configuration is required – these are disabled by default to avoid unnecessary runtime overhead.
...
Code Block | ||||
---|---|---|---|---|
| ||||
<bean id="org.apache.cxf.management.InstrumentationManager" class="org.apache.cxf.management.jmx.InstrumentationManagerImpl" init-method="init"> <property name="bus" ref="cxf" /> <property name="enabled" value="true" /> <property name="JMXServiceURLusePlatformMBeanServer" value="service:jmx:rmi:///jndi/rmi://localhost:9914/jmxrmitrue" /> </bean> |
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
Code Block | ||||
---|---|---|---|---|
| ||||
<cxf:bus bus="cxf"> <cxf:properties> <entry key="bus.jmx.enabled" value="true" /> <entry key="bus.jmx.JMXServiceURL" value="service:jmx:rmi:///jndi/rmi://localhost:9914/jmxrmi" /> <entry key="bus.jmx.usePlatformMBeanServer" value="true" /> </cxf:properties> </cxf:bus> |
...
To test the configuration start up your service and connect to it by using JConsole from the JDK.
Then you can browse to your endpoint:
Anchor | ||||
---|---|---|---|---|
|
...
Remote access
Starting from CXF 3.3.6, it is possible to secure remote Remove access to the RMI Connector via the "environment" variable. Here is an JMX is configured using the standard JVM JMX options. For example:
Code Block | ||
---|---|---|
xml | xml | <bean id="org.apache.cxf-Dcom.sun.management.InstrumentationManager" class="org.apache.cxf.management.jmx.InstrumentationManagerImpl" init-method="init"> <property name="enabled" value="true"/> <property name="bus" ref="cxf"/> <property name="JMXServiceURL" value="jmxremote -Dcom.sun.management.jmxremote.port=9913 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=localhost |
Then you can connect using jconsole specifying either of the following for the remote process:
- localhost:9913
- service:jmx:rmi:///jndi/rmi://localhost:
...
where jmx.password and jmx.access contain something like:
- jmx.password: admin cxf
- jmx.access: admin readwrite9913/jmxrmi
Configuring CXF to Use the ServiceMix 4 MBeanServer
...
Code Block | ||||
---|---|---|---|---|
| ||||
<!-- 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>
|
...