Saturday, October 30, 2010

Resequencing in SOA Suite 11g

As from the name it is clear it is used for sequencing,

Consider a scenario where in we have several input file coming into our process and it is in return producing some output ,The input file coming are in random order so the output produced will also be same random error.

From SOA Suite 10.1.3.5 and SOA Suite 11g PS2 we have this new feature called resequencer.IT will sequence the output file in a sequence independent of the input order.Earlier it was very difficult as we had to design xsd in order to sort the output element based on some element in the output.

ttp://soa-bpel-esb.blogspot.com/2010/05/sorting-elements-in-bpel.html


We will just see and example and try to understand how does this feature works in SOA Suite 11g


There are three type of resequencer

1>Standard Resequencer

2>FIFO Resequencer

3>BestEffort Resequencer

For more information on these you can refer to resequencer document in oracle




I have created a simple process to understand the use case of resequencer

It has a file adapter for receiving input

A mediator for resequencing and again a file adapter for generating output.

I am taking three variable as input

name,empid,comany from file adapter

In mediator i am using resequencer in standard mode

i have used the first field "name" as group id

and second field "empid" as Id with an increment of 1

There is a simple mapping in mediator where in i am copying the input to
output variable.

Now i have checked this process with following input in sequence as shown
below

ram,1,abc

ram,3,abc

ram,2,abc

What i have observed is that an output file is not generated for second input

ram,3,abc

Only when i place the third input file

ram,2,abc

All the three instances are generated,so it is working as expected.

Now i want to process it again from the beginning so i deleted all the
instance and all the file generated in output folder and rechecked it with
the same data in same sequence but this time instance were created but output
file was not created for me.

I put one more input file

ram,4,abc

and it was processed and an output file was created .

resequencig feature help in resequecing the data in a proper order.

Let suppose you are using a Standard Resequencer and sequencing on a

particular attibute "X" and the sequencing increment is provided as 1

Then the data will be processed only when you will provide the input in

a sequence of 1,2,3... of X.

If it happens to be 1,2,3,5

then it will stop after 3 and will wait for 4 to come

Once 4 will come it will then complete the 5th one and so on

One important thing is that once it has started processing data

from 1,2,3 onwards you can not use the same seauence again i.e. 1,2,3

because these data are stored in database so if you want to use the same

sequence again you need to manually clear it from database.

Keep in mind that reactivating the process will also not work for the

same sequence you will have to clear it from database.

Further you can create different groups for different sequence.

No comments: