Recent Blog Entries

Friday, 25 May 2012

Tracking the cluster node of BPEL instance invocations in SOA / AIA 10g

In a BPEL 10g cluster you often have the situation that incoming messages are picked up by adapters (i.e. JMSAdapter) on all nodes in parallel. Verifying if all nodes pickup these messages evenly is not easy in 10g because the processing cluster node is not saved in the DB schema. You can scan the log files (assuming you have the right log level) but there is a more elegant way:

1. Include in the BPEL processes at the beginning of a flow/transaction  (like ProcessSalesOrderFulfillmentSiebelCommsReqABCSImpl in AIA Comms PIPs) or in a Provider ABCS you want to track the following code snippet at the beginning (after the initial receive activity):

<bpelx:exec name="Java_Embedding_1" language="java" version="1.5">
      <![CDATA[try {      
    java.net.InetAddress addr = java.net.InetAddress.getLocalHost();      

    // Get IP Address (only if needed)
    // byte[] ipAddr = addr.getAddress();      

    // Get hostname      
    String hostname = addr.getHostName();  

    setIndex(1,hostname); 
} catch (Exception e) {      
}]]>

</bpelx:exec>

      This will save the hostname of the machine where the instance was executed to the custom index field 1 in the bpel instance.
2. This index field can then be displayed in the BPEL Console

bpel

3. This value can also be queried using a SQL statement on schema ORABPEL , joining CUBE_INSTANCE and CI_INDEXES based on CIKEY, showing the count of all executions per node:

select count(1), index_1 from CI_INDEXES, CUBE_INSTANCE where CI_INDEXES.CIKEY = CUBE_INSTANCE.CIKEY group by index_1;

With this you can verify if the bpel invocations in the cluster are processed evenly.
This approach should have almost no performance impact (can be permanent) and enable tracking of the distribution of the instance invocations in 10g.

In SOA 11g this is not needed anymore because CREATE_CLUSTER_NODE_ID and LAST_CLUSTER_NODE_ID are already part of CUBE_INSTANCE.

No comments:

Post a Comment