Asynchronous and Synchronous BPEL processes, as their names imply, process a request in parallel or sequentially respectively.
Asynchronous BPEL Processes
You can envision the use case of an Asynchronous BPEL Process as:
- BPEL process A will invoke an asynchronous BPEL process B
- After invoking BPEL process B, BPEL process A will perform operations itself while BPEL process B performs its operations
- BPEL process A will receive a response from process B and continue on
As you can see, after invoking the asynchronous BPEL process, both process A and B continued to perform operations in parallel.
Synchronous BPEL Processes
You can envision the use case of a Synchronous BPEL Process as:
- BPEL process A will invoke an synchronous BPEL process C
- After invoking BPEL process B, BPEL process A must wait for BPEL Process C to complete its operations and respond before proceeding
- BPEL process A will receive a response from process C and continue on
As you can see, once process A invoked process B, the operations in B had to be completed first, sequentially, before process A could move on.
Differences in Invoking Asynchronous vs Synchronous Processes
Create a New BPEL Project
Select Asynchronous Template’ or ‘Synchronous’ Template and Click ‘Finish’
Invoke an asynchronous process
- Create a invoke activity and associate to the partnerlink of the asynchronous flow
- Create a receive activity and associate to the partnerlink of the asynchronous flow
Invoke a synchronous process
- Create a receive activity and associate to the partnerlink of the synchronous flow
Screenshot: Invoke Asynchronous BPEL Process (left) and Synchronous BPEL Process (right)
Configuring Timeout Properties for Synchronous Partnerlink
Synchronous Flows have a default timeout for 60 seconds. If you feel your synchronous flow will take more than 60 seconds to complete. You can configure timeout property in the partnerlink.
Edit synchronous bpel’s partnerlink
Go to the properties tab and add a new property
When Should Each Be Used?
I consider creating asynchronous processes to be a more flexible practice. From a process standpoint,invoking and then immediately receiving from asynchronous processes provides you the same synchronicity. One use case where you might want to use synchronous BPEL processes is when you invoke the BPEL process from an external application, like a web application that requires a request-response model; asynchronous BPEL processes do not follow that structure.