Wednesday, August 15, 2007

SOA Suite 10.1.3.3 - Remote fault policies

Prior to SOA Suite 10.1.3.3 one could specify the partnerlink properties retryMaxCount and retryInterval for retrying remote partner link faults within the bpel.xml file:

<partnerLinkBinding name="mypartnerlink">
<property name="wsdlLocation">theWSDL.wsdl</property>
<property name="retryMaxCount">4</property>
<property name="retryInterval">60</property>
</partnerLinkBinding>


In 10.1.3.3 Oracle decided to add a "aspect oriented" fault managment policy framework to ease fault management and to keep it in a central location.

In 10.1.3.3, the the partnerlink properties retryMaxCount and retryInterval are thenfore ignored and the new fault management policies needs to be used instead of the old setup.

The fault managment setup consists of the following files:

  • %ORACLE_HOME%\bpel\domains\\config\fault-bindings.xml
  • %ORACLE_HOME%\bpel\domains\\config\fault-policies\*.xml

Note: If you create a new domain you will need to create the files manually since they are not created by default.

Here "fault-bindings" refers to policies defined in the "fault-polices" folder. That is the fault-bindings file defines which policies that are to be appliced to which processes/partnerlinks.

The XML Schema definitions for the fault policy settings are avaliable in the XMLLIB location:

  • %ORACLE_HOME%\bpel\system\xmllib\fault-policy-binding.xsd and
  • %ORACLE_HOME%\bpel\system\xmllib\fault-policy.xsd

Fault bindings
The fault bindings file defines that fault policy for a specific file so it basically just sets a default policy or specifies fault policies for a specific process:



The example fault bindings file has the following contents:

<?xml version="1.0" encoding="UTF-8"?>
<faultPolicyBindings version="2.0.1" xmlns="http://schemas.oracle.com/bpel/faultpolicy" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<!-- Enabling this will cause all processes in this domain to use this
fault policy -->

<process faultPolicy="DefaultPolicy"/>

<!-- DefaultPolicy is defined in ./fault-policies/DefaultPolicy.xml -->
<partnerLink faultPolicy="DefaultPolicy">

<!-- Enabling this will cause all invoke faults at partner link
name of "creditRatingService" to use fault policy with
id id = DefaultPolicy -->

<name>creditRatingService</name>

<!-- all invoke faults at partner link below port type use fault policy
with id = DefaultPolicy

The following entry covers the samples/tutorials/122.DBAdapter/InsertWithCatch sample. -->

<portType xmlns:db="http://xmlns.oracle.com/pcbpel/adapter/db/insert/">db:insert_plt</portType>
</partnerLink>
</faultPolicyBindings>

Fault policies

The fault polices file defines the action that will occur when a fault binding triggers. An action is defined as:

(Open image in the browser)

The actions provided are:

  1. retry - retry the operation "retryCount" times pausing "retryInterval" seconds between each iteration. If exponentialBackoff is set the "retryInterval" will be increased exponantially. "retryFailureAction" specifies what will happen if the retry operation fails and "retrySuccessAction" specifies an action to take if the retry operation is successful.

  2. rethrowFault - bubble up the fault to the closest "catch" handler

  3. humanIntervention - mark the work item to be "pending recovery from the BPEL console

  4. abort - terminate the instance

  5. replayScope - replay scope fault

  6. javaAction - execute a custom java function

A condition is used to "select" the appropriate action to be taken.


The example and default "DefaultPolicy.xml" file has the following contents:


<?xml version="1.0" encoding="UTF-8"?>
<faultPolicy version="2.0.1" id="DefaultPolicy" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.oracle.com/bpel/faultpolicy" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">



<!-- This section describes fault conditions. Build more conditions with faultName, test and action -->



<Conditions>
<!-- Fault if wsdlRuntimeLocation is not reachable -->
<faultName xmlns:bpelx="http://schemas.oracle.com/bpel/extension" name="bpelx:remoteFault">
<condition>



<action ref="ora-retry"/>
</condition>
</faultName>
<!-- Fault if location port is not reachable-->
<faultName xmlns:bpelx="http://schemas.oracle.com/bpel/extension" name="bpelx:bindingFault">
<condition>



<action ref="ora-rethrow-fault"/>
</condition>
</faultName>
</Conditions>
<Actions>



<!-- This action will attempt 8 retries at increasing intervals of 2, 4, 8, 16, 32, 64, 128, and 256 seconds. -->



<Action id="ora-retry">
<retry>
<retryCount>8</retryCount>
<retryInterval>2</retryInterval>
<exponentialBackoff/>
</retry>
</Action>




<!-- This is an action will cause a replay scope fault-->
<Action id="ora-replay-scope">
<replayScope/>
</Action>



<!-- This is an action will bubble up the fault-->
<Action id="ora-rethrow-fault"> <rethrowFault/>
</Action>



<!-- This is an action will mark the work item to be "pending recovery from console"-->
<Action id="ora-human-intervention">
<humanIntervention/>
</Action>



<!-- This action will cause the instance to terminate-->
<Action id="ora-terminate">
<abort/>
</Action>
</Actions>
</faultPolicy>

Sphere: Related Content

1 comment:

Unknown said...

Good overview.

What are the options in the condition "test" tag?

For example, have you tried to use a "contains" like this?
>contains($fault.summary/summary, "a")

Thanks.