AIA/SOA 11g Trips & Tricks: How to Save AIA/BPEL 11g Execution Time Statistics Programmatically in a File

Introduction

Update Feb 2018: Please note that this blog was written in 2012 when SOA 11g was available. The tools and APIs described in this blog will work only with the 11g version. Current version of SOA 12.2.

Accessing and saving statistics is quite different in SOA 11g – this is done through JXM MBeans and not by calling a BPEL API (as in 10g).

Main Article

The following example shows how to retrieve the execution time statistics for all BPEL components deployed to one SOA server.

The example output is:

FOUND 15
 Time    BPEL Name    Count    Min    Avg    Max
 11:48:19    ProcessFOBillingAccountListRespOSMCFSCommsJMSProducer    6    326    2568.6666666666665    3068
 11:48:19    UpdateSalesOrderSiebelCommsProvABCSImplProcess    6    1482    1821.5    2236
 11:48:19    CommsProcessFulfillmentOrderBillingAccountListEBF    6    16590    22458.5    29167
 11:48:19    ProcessFulfillmentOrderBillingResponseOSMCFSCommsJMSProducer    6    28    166.5    842
 11:48:19    AIAAsyncErrorHandlingBPELProcess    4    1459    1758.5    2065
 11:48:19    ProcessFulfillmentOrderBillingBRMCommsProvABCSImplProcess    6    1805    2462.8333333333335    4031
 11:48:19    QueryCustomerPartyListSiebelProvABCSImplV2    10    640    2639.8    11079
 11:48:19    AIASessionPoolManager    20    13    96.0    1344
 11:48:19    ProcessSalesOrderFulfillmentOSMCFSCommsJMSProducer    10    94    562.9    1930
 11:48:19    ProcessFulfillmentOrderBillingBRMCommsAddSubProcessProcess    6    773    1211.0    1577
 11:48:19    SyncCustomerPartyListBRMCommsProvABCSImpl    10    323    2956.0    4045
 11:48:19    TestOrderOrchestrationEBF    6    39979    46680.166666666664    52206
 11:48:19    ProcessSalesOrderFulfillmentSiebelCommsReqABCSImplProcess    10    1125    2247.1    6522
 11:48:19    CommsProcessBillingAccountListEBF    10    7342    12365.5    22876
 11:48:19    AIAReadJMSNotificationProcess    4    9    54.5    124

You can easily paste the output in Excel to display charts like:
image_thumb[1]
image_thumb

You also can periodically retrieve the statistics to determine if there is any performance degrade for some BPEL processes over time.
Lets see how the JMX API is used to achieve this:
First we need to establish a connection to the MBean server – for this we use the same method as we did in our JMXClient:

public static void initConnection(String hostname, String portString,
 String username,
 String password) throws IOException,
 MalformedURLException {
 String protocol = "iiop";
    Integer portInteger = Integer.valueOf(portString);
 int port = portInteger.intValue();
 String jndiroot = "/jndi/";
 String mserver = "weblogic.management.mbeanservers.domainruntime";
    JMXServiceURL serviceURL =
 new JMXServiceURL(protocol, hostname, port, jndiroot + mserver);
    Hashtable h = new Hashtable();
 h.put(Context.SECURITY_PRINCIPAL, username);
 h.put(Context.SECURITY_CREDENTIALS, password);
 h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
 "weblogic.management.remote");
 // Wait timeout 60 seconds
 h.put("jmx.remote.x.request.waiting.timeout", new Long(60000));
 connector = JMXConnectorFactory.connect(serviceURL, h);
 connection = connector.getMBeanServerConnection();
 }

After that we retrieve all Mbeans which have the same pattern:

String mBeanName =
 "oracle.dms:Location=" + servername + ",soainfra_composite_label=*,type=soainfra_component,soainfra_component_type=bpel,soainfra_composite=*,soainfra_composite_revision=*,soainfra_domain=default,name=*";
Set<ObjectInstance> mbeans =
 connection.queryMBeans(new ObjectName(mBeanName), null);
 System.out.println("FOUND " + mbeans.size());

This matches the display in Enterprise Manager “System MBean Browser”:

EM2_thumb

 

Now, we can query each MBean for the attributes

  • Name
  • successfulInstanceProcessingTime_completed
  • successfulInstanceProcessingTime_minTime
  • successfulInstanceProcessingTime_avg
  • successfulInstanceProcessingTime_maxTime

That’s it!

You can find the complete JDeveloper project here

The same statistics can of course be retrieved as well programmatically for composites (services) and references.

Comments

  1. Khatri Rajesh says:

    Hello, We are on SOA 12.1.3 and want to develop a Heath check process to monitor a) if any of critical business services become unavailable or unreachable. b) Monitor Data sources are not targeted or not reachable

    Can you please guys suggest any tool or API that we can leverage. Do you think if we can use JMX monitoring APIs for this or use facade API. do you have any examples. Please share your experience.

    Thanks.

    I am thinking of writing script Phython to periodically monitor the critical composites and data sources and send notifications if they are not reachable.

Add Your Comment