Monitoring JMX Based Statistics
Java Management Extensions (JMX) is a technology that lets you implement management interfaces for Java applications. JConsole is a JMX-compliant monitoring tool, which comes with the Java Development Kit (JDK) 1.5 or later versions. WSO2 ESB is shipped with inbuilt support for JMX (Java Management Extension) monitoring. Â
This section illustrates how you can use JMX monitoring to monitor statistics relating to artifacts that are deployed in your ESB server. This is done using the Mediation Flow Statistics View Mbean.
Follow the steps below to enable and view JMX based mediation flow statistics for WSO2 ESB.
Enable mediation flow statistics in theÂ
<ESB_HOME>/repository/conf/synapse.properties
file as shown below.mediation.flow.statistics.enable=true mediation.flow.statistics.tracer.collect.payloads=true mediation.flow.statistics.tracer.collect.properties=true
- Start the WSO2 ESB server. For more information, see Running the Product.
- Open the JConsole tool and connect to the ESB server. For instructions, see Monitoring a WSO2 Product with JConsole in the WSO2 Administration Guide.Â
- Go to the MBeans tab in the JConsole and navigate to
org.apache.synapse
/Mediation Flow Statistic View/MediationFlowStatisticsView/Operations
 to view all available operations. In here, you can view JMX statistics relating to proxy services, REST APIs, inbound endpoints, endpoints and sequences.Â
For example, to view JMX statistics for a proxy service selectgetProxyServiceJMXStatistics
from the list of operations. Provide the artifact name in p0 field under Composite Data and and click getProxyServiceJMXStatistics button to perform the relevant operation invocation.Â
The MediationFlowStatisticsView MBean has the following operations:
Operation Name | Description |
---|---|
resetAPIStatistics | Clear recorded API statistics and restart recording. |
resetProxyStatistics | Clear recorded proxy service statistics and restart recording. |
resetSequenceStatistics | Clear recorded sequence statistics and restart recording. |
resetInboundEndpointStatistics | Clear recorded inbound endpoint statistics and restart recording. |
resetEndpointStatistics | Clear recorded endpoint statistics and restart recording. |
resetAllStatistics | Clear recorded statistics for all ESB artifacts and restart recording. |
getProxyServiceJMXStatistics | Retrieve JMX statistics for proxy service. |
getSequenceJMXStatistics | Retrieve JMX statistics for sequence. |
getAPiJMXStatistics | Retrieve JMX statistics for API. |
getInboundEndpointJMXStatistics | Retrieve JMX statistics for inbound endpoint. |
getEndpointJMXStatistics | Retrieve JMX statistics for endpoint. |
Disabling the JMX observer
The JMX observer can be disabled by adding the following property to the  <ESB_HOME>/repository/conf/carbon.xml
file.
<MediationFlowStatisticConfig> <JmxPublishingDisable>true</JmxPublishingDisable> </MediationFlowStatisticConfig>
For details on using JMX monitoring to monitor your ESB server, see JMX Monitoring.