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.

Thursday, 10 May 2012

Setting up the AQ Connection from Oracle BRM to AIA 11.2 in the Order to Cash and AABC PIPs

When you install the AIA 11.2 “Comms Order to Cash: SBL CRM and BRM Pre-Built Integration” you will be asked for the BRM Connection Details:

I used the following settings for my environment:

clip_image002

After successful Deployment I got the following errors at startup of soa_server1:

AdapterFrameworkImpl::endpointActivation - Endpoint Activation Error.
The Resource Adapter AQ Adapter was unable to activate the endpoint oracle.tip.adapter.aq.inbound.AQDequeueActivationSpec:{Correlation=DiscountInfoChange, QueueName=BRMQUEUE, DatabaseSchema=brm, SchemaValidation=false} due to the following reason: BINDING.JCA-11975
AQ_INVALID_QUEUE.
Unable to obtain queue table name.
Queue does not exist or not defined correctly.
Drop and re-create queue.

and

AdapterFrameworkImpl::endpointActivation - Endpoint Activation Error.
The Resource Adapter AQ Adapter was unable to activate the endpoint oracle.tip.adapter.aq.inbound.AQDequeueActivationSpec:{Correlation=ProductInfoChange, QueueName=BRMQUEUE, DatabaseSchema=brm, SchemaValidation=false} due to the following reason: BINDING.JCA-11975
AQ_INVALID_QUEUE.
Unable to obtain queue table name.
Queue does not exist or not defined correctly.
Drop and re-create queue.

Cause:

I missed the small note in the 11.2 PIP installation guide saying

Oracle AQ Username: ….Note: This value must be in uppercase (PIN7820) for the OOTB PLM flow to work.

This issue is described in Oracle Support Note ID 1436317.1 : Unable to dequeue data from BRM Queue in O2C Integration

Solution:

Undeploying, reconfiguring  and reinstalling the PIP as mentioned in the note is not necessary. You can correct the invalid lowercase AQ Schema name by modifying the following 2 files:

  • <AIAHome>/services/industry/Communications/BRM/AdapterServices/SyncDiscountInfoChangeBRMAQ/SyncDiscountInfoChangeBRMAQ_aq.jca
  • <AIAHome>/services/industry/Communications/BRM/AdapterServices/SyncProductInfoChangeBRMAQ/SyncProductInfoChangeBRMAQ_aq.jca

Change this to include the uppercase schema name and redeploy both 2 processes:

<property name="DatabaseSchema" value="BRM"/>

Alternatively you can change the value in EM Console:

image

See http://docs.oracle.com/cd/E26778_01/doc.112/e26495/commsordertobill.htm

PS: If you don’t have a fully functional Oracle BRM installation, it is sufficient for the PIP installation to create the BRM schema and the AQ queue:

BEGIN DBMS_AQADM.CREATE_QUEUE_TABLE
(Queue_table => 'brm.brm_qtt',
Queue_payload_type =>
'SYS.AQ$_JMS_TEXT_MESSAGE', compatible =>
'10.0.0');
END;


BEGIN DBMS_AQADM.CREATE_QUEUE (Queue_name
=> 'brm.brmqueue',
Queue_table =>
'brm.brm_qtt');
END;

BEGIN
DBMS_AQADM.START_QUEUE (Queue_name =>
'brm.brmqueue');
END;