This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
JMX Monitoring
WSO2 ESB exposes a number of management resources as JMX MBeans that can be used for managing and monitoring the running server. These MBeans can be accessed remotely using a JMX client such as JConsole. This page describes how to monitor the ESB using JMX in the following sections:
JMX service URL
When WSO2 ESB is starting up, it will display the JMX Service URL in the console as follows.
INFO - JMXServerManager JMX Service URL : service:jmx:rmi://localhost:11111/jndi/rmi://localhost:9999/jmxrmi
This URL can be used to remotely access the JMX Service exposed by WSO2 ESB. The following section describes how to use JConsole as the JMX client to access this service.
Using JConsole
Start JConsole and enter the above URL as the JMX Service URL. Type "admin" in both username and password fields and click "Connect".
Make sure that the user ID you are using for JMX monitoring is assigned a role which has the Server Admin permission in the Permissions of the Role page. See Configuring Roles for further information about configuring roles assigned to users.
Tip
If you are intending to establish a remote connection (over a network or into a VM), make sure that the server has been started with the -Djava.rmi.server.hostname=<IP_ADDRESS_WHICH_YOU_USE_TO_CONNECT_TO_SERVER>
option. For more information read Troubleshooting Connection Problems in JConsole.
After successfully connecting to the JMX service, click on "MBeans" tab of JConsole to view MBeans exposed by the ESB, which are listed under the org.apache.axis2, org.apache.synapse, and org.wso2.carbon nodes. The following section summarizes the attributes and operations available in MBeans exposed by the WSO2 ESB.
Attributes and Operations of MBeans
Transport MBeans
For each transport listener and sender enabled in the ESB, there will be an MBean under the org.apache.axis2/Transport node that has the following attributes and operations. For example, when the JMS transport is enabled, the following MBean will be exposed:
org.apache.axis2/Transport/jms-sender-n
Additionally, the MBeans under the org.apache.synapse/Transport node expose these attributes for the default HTTP and HTTPS transports:
- org.apache.synapse/Transport/passthru-http-receiver
- org.apache.synapse/Transport/passthru-http-sender
- org.apache.synapse/Transport/passthru-https-receiver
- org.apache.synapse/Transport/passthru-https-sender
Attribute/Operation Name | Description |
ActiveThreadCount | Threads active in this transport listener/sender. |
AvgSizeReceived | Average size of received messages. |
AvgSizeSent | Average size of sent messages. |
MaxSizeReceived | Maximum message size of received messages. |
MaxSizeSent | Maximum message size of sent messages. |
MinSizeReceived | Minimum message size of received messages. |
MinSizeSent | Minimum message size of sent messages. |
MessagesReceived | Total number of messages received through this transport. |
MessagesSent | Total number of messages sent through this transport. |
FaultsReceiving | Number of faults encountered while receiving. |
FaultsSending | Number of faults encountered while sending. |
BytesReceived | Number of bytes received through this transport. |
BytesSent | Number of bytes sent through this transport. |
QueueSize | Number of messages currently queued. Messages get queued if all the worker threads in this transport thread pool are busy. |
ResponseCodeTable | Number of messages sent against their response codes. |
TimeoutsReceiving | Message receiving timeout. |
TimeoutsSending | Message sending timeout. |
LastResetTime | Last time transport listener/sender statistic recording was reset. |
MetricsWindow | Time difference between current time and last reset time in milliseconds. |
resetStatistics() | Clear recorded transport listener/sender statistics and restart recording. |
start() | Start this transport listener/sender. |
stop() | Stop this transport listener/sender. |
pause() | Pause this transport listener/sender which has been started. |
resume() | Resume this transport listener/sender which is currently paused. |
maintenenceShutdown(long gracePeriod) | Stop processing new messages, and wait the specified maximum time for in-flight requests to complete before a controlled shutdown for maintenence. |
Latency MBeans
These MBeans provide latency statistics for the HTTP and HTTPS transports. For example:
- org.apache.synapse/PassthroughHTTPLatencyView/passthru-http
- org.apache.synapse/PassthroughHTTPSLatencyView/passthru-https
Attribute/Operation Name | Description |
AllTimeAvgLatency | Average latency since latency recording was last reset. |
LastXxxAvgLatency | Average latency for last Xxx time period. For example, LastHourAvgLatency return the average latency for last hour. |
LastResetTime | Last time latency statistic recording was reset. |
reset() | Clear recorded latency statistics and restart recording. |
Connection MBeans
These MBeans provide connection statistics for the HTTP and HTTPS transports. For example:
- org.apache.synapse/PassThroughConnections/http-listener
- org.apache.synapse/PassThroughConnections/http-sender
- org.apache.synapse/PassThroughConnections/https-listener
- org.apache.synapse/PassThroughConnections/https-sender
Attribute/Operation Name | Description |
ActiveConnections | Number of currently active connections. |
ActiveConnectionsPerHosts | A map of number of connections against hosts. |
LastXxxConnections | Number of connections created during last Xxx time period. |
RequestSizesMap | A map of number of requests against their sizes. |
ResponseSizesMap | A map of number of responses against their sizes. |
LastResetTime | Last time connection statistic recordings was reset. |
reset() | Clear recorded connection statistics and restart recording. |
Threading MBeans
These MBeans are only available in the NHTTP transport and not in the default Pass Through transport.
- org.apache.synapse/Threading/HttpClientWorker
- org.apache.synapse/Threading/HttpServerWorker
Attribute/Operation Name | Description |
TotalWorkerCount | Total worker threads related to this server/client. |
AvgUnblockedWorkerPercentage | Time-averaged unblocked worker thread percentage. |
AvgBlockedWorkerPercentage | Time-averaged blocked worker thread percentage. |
LastXxxBlockedWorkerPercentage | Blocked worker thread percentage averaged for last Xxx time period. |
DeadLockedWorkers | Number of deadlocked worker threads since last statistics reset. |
LastResetTime | Last time thread statistic recordings was reset. |
reset() | Clear recorded thread statistic and restart recording. |
Proxy service MBeans
Navigate to one of the following operations in the org.wso2.carbon/StatisticsAdmin/Operations MBean, type the proxy service name, and press Enter to get statistics for that service:
Operation | Description |
---|---|
getServiceRequestCount | Total requests to this service |
getServiceFaultCount | Total faults from this service |
getServiceResponseCount | Total responses by this service |
getMaxServiceResponseTime | Maximum response time by this service |
getMinServiceResponseTime | Minimum response time by this service |
getAvgServiceResponseTime | Average response time by this service |
You can also go to org.apache.synapse/StatisticsView/StatisticsView/Operations/getSystemProxyServiceStats to get all of these statistics in a single view.