Monday, December 27, 2010

Debatching in SOA suite 11g


Debatching is a feature where in you break a large input data in to a number of small inputs,this is generally done in order to reduce load on the server.

This will be very clear with the following example

Let suppose i have an input file with following data in a text file

called input.txt

ram,123,ibm
Shyam,234,cisco
Pasha,345,CTS
Kallol,456,TCS

As you can see it is a comma separated value.

We have a file adapter which will be polling for the record.
But assume that due to perfromance issue we want that the record
should be processed two at a time that is i want that first only

ram,123,ibm
Shyam,234,cisco

should be processed and then

Pasha,345,CTS
Kallol,456,TCS

should be processed in second stretch,however i dont want to intiate the process again.In this scenario i will use the debatcing feature of SOA Suite 11g.

This will process a single record twice using two records at a time thus will create two instance for the record.

We will see how we can achieve this target in SOA Suite.




My process will look something like this,

where in i am polling the same record which i have taken as example here

then finally in am just writing this to another file location.So its just a simple file inobund outbound scenario.

Now the only setting that you need to understand in debatching is in file filtering page as shown below




AS you can see we have selected the option

Files contain Multiple Messages PublishMessages in Batches of

and then i have chosen value as "2"

which means i want my data to be processed in a batch of "2"

Now if you will go to the code level .jca file for this

you will find that following property has been added for this

property name="PublishSize" value="2"

So now our requirement is fulfilled.

Now you can download my project ,change the location of input and output as per your server location and check the process with the same input as i have metioned here.

Two instance will be created and two output files will be generated for it.

1 comment:

Anonymous said...

Spot on with this write-up, I really feel this amazing site needs
a great deal more attention. I'll probably be returning to read more,
thanks for the advice!