Monitoring endpoint activity

Use the MBean APIs to monitor the inbound and outbound endpoint activity in a solution. The APIs retrieve information about solution connectivity that you can use to assess the performance of your inbound and outbound endpoints.

About this task

The InboundEndpointMonitorMXBean provides methods to capture the following performance metrics:
  • the number of rejected messages
  • the number of discarded messages
  • the number of failed delivery attempts
  • the number of messages presented to the endpoint.
  • the number of submitted events that are not routed to any agent
  • the number of submitted events that are routed to one or more agents
  • the total time taken to parse, classify, transform and submit events, expressed in nanoseconds.
The OutboundEndpointMonitorMXBean provides methods to capture the following performance metrics:
  • the number of abandoned messages
  • the number of rolled back message delivery attempts
  • the number of messages successfully delivered to the endpoint
  • the total time taken to deliver messages to the endpoint, expressed in nanoseconds

The MBean can be used in external tooling or programmatically.

Procedure

  1. Connect to the MBean server and create an MBeanServer instance for the application code that is running on the Liberty profile. See the Connecting to the MBean server topic for an example of the MBean server connection code.
  2. Activate the MBean interface by calling the javax.management.JMX.newMXBeanProxy method, which enables the MXBeans to obtain a proxy object. See Working with JMX MBeans on the Liberty profile in the Liberty profile documentation.
  3. Retrieve statistics for an inbound endpoint by using the ObjectName object with the value com.ibm.ia:type=InboundEndpointMonitor,name=<solution_name>/<endpoint_name>, where <solution_name> is the name of the solution that you want to monitor and <endpoint_name> is the name of an endpoint that is defined in the solution.
  4. Retrieve statistics for an outbound endpoint by using the ObjectName object with the value com.ibm.ia:type=OutboundEndpointMonitor,name=<solution_name>/<endpoint_name>, where <solution_name> is the name of the solution that you want to monitor and <endpoint_name> is the name of an endpoint that is defined in the solution.

Example

Monitoring inbound endpoints
The following example shows how to retrieve the total message count and the total invocation time of the endpoint that is named MySolution/HTTPTransactionEventEndPoint:
MBeanServerConnection mbsc = getMBeanServerConnection(); 
ObjectName objectNameIEM = new
ObjectName("com.ibm.ia:type=InboundEndpointMonitor,name=MySolution/HTTPTransactionEventEndPoint");
InboundEndpointMonitorMXBean beanIEM = JMX.newMXBeanProxy(mbsc, objectNameIEM,
InboundEndpointMonitorMXBean.class);     
System.out.println("Total message count: "+ beanIEM.getTotalMessageCount());     
System.out.println("Total inbound processing time: "+beanIEM.getTotalProcessingTime());
Monitoring outbound endpoints
The following example shows how to retrieve the total message count and the total invocation time of the endpoint that is named MySolution/JMSOutboundEndpoint:
MBeanServerConnection mbsc = getMBeanServerConnection();
ObjectName objectNameOEM = new ObjectName("com.ibm.ia:type=OutboundEndpointMonitor,name=MySolution/JMSOutboundEndpoint");
OutboundEndpointMonitorMXBean beanOEM = JMX.newMXBeanProxy(mbsc, objectNameOEM, OutboundEndpointMonitorMXBean.class);
System.out.println("Number of successful deliveries: "+ beanOEM.getSuccessfulDeliveryCount());
System.out.println("Total outbound processing time: "+ beanOEM.getTotalProcessingTime());