Determining the number of pending events on an outbound endpoint

You can use the getPendingOutboundEventCount MBean method to find out how many events are on an outbound endpoint.

About this task

You can access Liberty server attributes and complete various server operations by using a Java™ Management Extensions (JMX) management bean (MBean). The Liberty server profile provides MBeans and corresponding management interfaces that you can use to manipulate and monitor the server.

Use the outbound connectivity MBean, com.ibm.ia:type=OutboundBufferManager, to determine the number of pending events on an outbound endpoint for a solution. The management interface for the MBean is com.ibm.ia.connectivity.management.OutboundBufferManagerMXBean.

After you create an MBeanServer instance for the Decision Server Insights application that is running on the Liberty profile, you can access the attributes or call the operations of the MBeans. Activate the MBean interface by calling the javax.management.JMX.newMXBeanProxy method, which enables the MXBeans to obtain a proxy object.

Procedure

  1. Connect to the MBean server and create an MBeanServer instance for the Decision Server Insights application code that is running on the Liberty profile. See the Administrator toolkit topic for an example of the MBean server connection code.
  2. Determine the number of pending events for the endpoint by using the getSolutionEndpointDepth MBean.
    getPendingOutboundEventCount():
    
    try {
    MBeanServerConnection connection = getConnection(hostName, port, adminUsername, adminPassword, trustStorePath, trustStorePassword);
    
    Long depth = (Long) connection.invoke(new ObjectName("com.ibm.ia:type=OutboundBufferManager"), "getPendingOutboundEventCount", new Object[] {solutionName, endpointName}, new String[] {String.class.getName(), String.class.getName()});
    
    } catch (JMXException e) {
    e.printStackTrace();
    }