Category: Design Patterns



Many a times I have noticed that when you use DB Adapters (SOA Suite 11g) for integrating with applications like the E Business Suite in a clustered high availability environment, at times there will be multiple instances for the same request.

The number of instances each entry in the DB would generate would directly correlate to the number of nodes on a cluster.

Such that if there are 3 nodes on the soa cluster then the polling composite deployed on each of the managed servers would be attempting to process this file and you would end up with extra instances of the composite which would result in errors or processing the item multiple times depending on the business process.

There are 2 different solutions for this problem on the blogs and you can chose anyone depending on which one suits your particular scenario.

However I prefer the quick an easy one to use the singleton property of the JCA DB adapter .

Ideally you would want to do this from the source in the composite.xml

There’s a property of Inbound endpoint lifecycle support within Adapters called Singleton.
To enable this feature for high availability environment for a given inbound adapter endpoint, one must add the singleton JCA service binding property in the composite.xml within the <binding.jca> element and set it to a value of true as shows.

Singleton Property in composite.xml
    <binding.jca config="bindin_file.jca">
        <property name="singleton">true</property>
    </binding.jca>

More details about this are available @

http://docs.oracle.com/cd/E23943_01/integration.1111/e10231/life_cycle.htm#BABDAFBH

Runtime Fix

However on an already deployed composite you can go composite dashboard and open the properties tab for the db adapter component from the EM console and add a new property
you will see ‘singleton’ in that list and we can set it to ‘true’

Click Apply and Save.

This should result in the following row in your composite.xml which you can check from the xml definition in the composite dashboard.

<property  name="singleton"  type="xs:boolean"  many="false"  source="PollNYSolutionsJobsEBizReqABCS_ptt:receive[hdr]">true</property>

which is the equivalent of the change in the source code, Obviously you will lose this change if a subsequent deployment happens so make sure this is replicated to the source code as well.

The same can be achieved in OSB using by editing the Configuration Details of the proxy service and set ‘Topic Message Distribution’ to ‘One Copy Per Application’.

Refs:
http://javaoraclesoa.blogspot.co.uk/2012/04/polling-with-dbadapter-in-clustered.html
http://ayshaabbas.blogspot.co.uk/2012/11/db-adapter-singleton-behaviour-in-high.html

							

Hi All,

Recently I managed to get my hands on the recently launched Oracle Service Bus 11g Development Cookbook written by some of the industries most talented people in the FMW space, namely Guido Schmutz, Edwin Biemond, Jan van Zoggel , Mischa Kölliker and Eric Elzinga

The Book contains several recipes for real life problems we face when integrating using the Oracle Service Bus and some other components of the SOA Suite.

I haven’t still finished reading the book which will take me a few more days simply because the title contains over 80 recipes and I do plan to go through every single one of these even if that means I get my hands dirty.

It does make life easier as they have provided set up scripts to set up your environment and solutions for each of these recipes and they deserve credit for that. What that also means that you don’t need to complete all the problems before you get to a specific recipe.

I would be sharing more on my thoughts after going through some of these recipes but my initial impressions of the book are it’s quite promising and would soon be a must have for all OSB and Fusion Middleware developers.

If you can’t wait for my review then the book is available on Amazon and You can buy this book from Amazon using the link below.

Also on PackT @ http://www.packtpub.com/oracle-service-bus-11g-development-cookbook/book

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format

Watch out this space for more on the OSB cook book and some recipes from the book.


It’s very common that you have to define a WSDL and want it to have custom header.

I have been using WSDL’s with custom headers for some time and thought I will post this sample WSDL for all of you who want to define a SOAP 1.1 WSDL with a custom message header.

Below is a Sample SOAP 1.1 WSDL with custom headers.

LocationFinderService.wsdl

<?xml version=”1.0″ encoding=”UTF-8″ standalone=”no”?>

<wsdl:definitions xmlns:soap=”http://schemas.xmlsoap.org/wsdl/soap/&#8221;

xmlns:tns=”http://www.nysolutionsltd.com/wsdl/utilityservices/addressfinderservice/LocationFinderServicev1.0/&#8221;

xmlns:wsdl=”http://schemas.xmlsoap.org/wsdl/&#8221;

xmlns:xsd=”http://www.w3.org/2001/XMLSchema&#8221;

name=”LocationFinderService”

xmlns:header=”http://www.nysolutionsltd.com/wsdlheaders/Headerv1.0&#8243;

targetNamespace=”http://www.nysolutionsltd.com/wsdl/utilityservices/addressfinderservice/LocationFinderServicev1.0/&#8221;

xmlns:xsd1=”http://www.nysolutionsltd.com/wsdlmessages/utilityservices/addressfinderservice/FindGeocodesForLocationv1.0″&gt;

<wsdl:types>

<xsd:schema

targetNamespace=”http://www.nysolutionsltd.com/wsdl/utilityservices/addressfinderservice/LocationFinderServicev1.0/”&gt;

</xsd:schema>

<xsd:schema xmlns:xsd=”http://www.w3.org/2001/XMLSchema”&gt;

<xsd:import

namespace=”http://www.nysolutionsltd.com/wsdlmessages/utilityservices/addressfinderservice/FindGeocodesForLocationv1.0&#8243;

schemaLocation=”../../../../../ServiceSchemas/internal/wsdlmessages/utilityservices/addressfinderservice/FindGeocodesForLocation.xsd”>

</xsd:import>

<xsd:import

schemaLocation=”../../../../../ServiceSchemas/internal/wsdlheaders/HeaderSchema.xsd”

namespace=”http://www.nysolutionsltd.com/wsdlheaders/Headerv1.0&#8243; />

</xsd:schema>

</wsdl:types>

<wsdl:message name=”MessageHeaderType”>

<wsdl:documentation>

The Messages used in the operations of this service are

defined here. The element attribute refers to the various

types defined in the schema.

</wsdl:documentation>

<wsdl:part name=”MessageHeaderType”

element=”header:MessageHeaderType” />

</wsdl:message>

<wsdl:message name=”findGeocodesForLocationRequest”>

<wsdl:part element=”xsd1:findGeocodesForLocationRequest”

name=”parameters” />

</wsdl:message>

<wsdl:message name=”findGeocodesForLocationResponse”>

<wsdl:part element=”xsd1:findGeocodesForLocationResponse”

name=”parameters” />

</wsdl:message>

<wsdl:portType name=”LocationFinderService”>

<wsdl:operation name=”findGeocodesForLocation”>

<wsdl:input message=”tns:findGeocodesForLocationRequest” />

<wsdl:output message=”tns:findGeocodesForLocationResponse” />

</wsdl:operation>

</wsdl:portType>

<wsdl:binding name=”LocationFinderServiceSOAP”

type=”tns:LocationFinderService”>

<soap:binding style=”document”

transport=”http://schemas.xmlsoap.org/soap/http&#8221; />

<wsdl:operation name=”findGeocodesForLocation”>

<soap:operation

soapAction=”http://www.nysolutionsltd.com/wsdl/utilityservices/addressfinderservice/LocationFinderServicev1.0/findGeocodesForLocation&#8221; />

<wsdl:input>

<soap:header message=”tns:MessageHeaderType”

part=”MessageHeaderType” use=”literal” />

<soap:body use=”literal” />

</wsdl:input>

<wsdl:output>

<soap:body use=”literal” />

</wsdl:output>

</wsdl:operation>

</wsdl:binding>

<wsdl:service name=”LocationFinderService”>

<wsdl:port binding=”tns:LocationFinderServiceSOAP”

name=”LocationFinderServiceSOAP”>

<soap:address location=”http://www.nysolutionsltd.com/&#8221; />

</wsdl:port>

</wsdl:service>

</wsdl:definitions>

For Custom headers

Things to note are to define the custom header type:

<xsd:schema xmlns:xsd=”http://www.w3.org/2001/XMLSchema”&gt;

<xsd:import

namespace=”http://www.nysolutionsltd.com/wsdlmessages/utilityservices/addressfinderservice/FindGeocodesForLocationv1.0&#8243;

schemaLocation=”../../../../../ServiceSchemas/internal/wsdlmessages/utilityservices/addressfinderservice/FindGeocodesForLocation.xsd”>

</xsd:import>

<xsd:import

schemaLocation=”../../../../../ServiceSchemas/internal/wsdlheaders/HeaderSchema.xsd”

namespace=”http://www.nysolutionsltd.com/wsdlheaders/Headerv1.0&#8243; />

</xsd:schema>

</wsdl:types>

<wsdl:message name=”MessageHeaderType”>

<wsdl:documentation>

The Messages used in the operations of this service are

defined here. The element attribute refers to the various

types defined in the schema.

</wsdl:documentation>

<wsdl:part name=”MessageHeaderType”

element=”header:MessageHeaderType” />

</wsdl:message>

And to include that in the input message:

<wsdl:input>

<soap:header message=”tns:MessageHeaderType”

part=”MessageHeaderType” use=”literal” />

<soap:body use=”literal” />

</wsdl:input>

For Soap 1.1 the namespace have to be

xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/

NOTE: this can be used with SOAP1.2 as well but you just need to update the WSDL bindings etc.

I will try and post a SOAP1.2 WSDL as well. But that’s for another day.

I use the O2 Broadband service its dirt cheap and service is so very good I would recommend the it to one and all.
http://nitinaggarwal.wordpress.com

Rajesh Raheja on Enterprise Software Development

My thoughts on Enterprise Software Technologies...and more.

Gilberto Holms

Java/SOA Architecture Blog

Universo Middleware

"Não é a agilidade da resposta que ficará marcada para sempre como o seu atributo mais forte, é a qualidade e a profundidade do que você está dizendo."

Enjoy IT - SOA, Java, Event-Driven Computing and Integration

Sharing my thoughts and experiences on SOA, Java in the Enterprise, Event-Driven Computing and Integration in the Enterprise

Oracle Technologies Premier

Technical posts on OSB/WLS/AIA, Oracle SOA Suite, BPM and Fusion Middleware

Java på svenska

Just another WordPress.com weblog

SOA Community Blog

by Jürgen Kress

Oracle .. Java .. OpenSource .. SOA

Just another WordPress.com weblog

Nitin's JAVA and SOA BLOG

SOA FMW BPM BPEL OSB J2EE and all the cool stuff

%d bloggers like this: