Monday, March 08, 2010

Asynchronous BPEL Process in SOA Suite

An asynchronous process is used in case of fire and forget condition.That is further processing is not hindered from the outcome of the process invoked.A simple asynchronous BPEL process looks like




Have a look in the last activity.It is callBack Client.
Asynchronous bpel process is recognized by the callback client activity as the last activity.Asynchronous BPEL process is used in most of the scenario.It means you called the process and you no longer need to wait for the outcome of the invoked process to further proceed of your process.Lets suppose we have to book some laptop from HCL.We filled the quotation and send it to the concerned place.Now we don't need an immediate reply from the HCL that the laptop is ready with the suggested configuration and you can take it now.All that is required is a confirmation or an acknowledgement that HCL has received the quotation,then we need not bother.It will be processed by HCL as per the list and you will get other details.So asynchronous process is not used in a scenario where in you need immediate response in milli seconds.

Depending upon the application one has to consider whether he should go for a synchronous or an asynchronous bpel process.


Now lets check what happens in case of an asynchronous process.

1>Clinet start a thread and post the input messsage to the delivery queue of the container.

2>The container has a message driven bean called as worker bean which continously poll on the delivery queue.Once it find a message in the queue it invokes it onMessage method and starts a new Thread,JTA also start a new JTA transaction.

3>Flow goes to receive activity.

4>The input variable is assigned to output variable in the assign activity.

5>finally when callback client the container looks for the connection pool and dehydrates the BPEL process in to the database.


There were no mid point activities and the asynchronous process completed in two separate threads and a single transaction.

As soon as the container finds a mid point acitivity in between the process it dehydrates the flow till that stage in to the database.

No comments: