The Async scope is a branch processing block that executes simultaneously with the main flow. The main flow continues to execute while it initiates and processes the Async processing. The flow does not have to pause until the last message processor embedded in the asynchronous flow has completed its task.
Async can be useful for executing time-consuming operations that do not require you to send a response back to the initiating flow.
The Async sends one copy of the message it has received to the first embedded message processor in its own processing block. At the same time, it sends another copy of the message to the next message processor in the main flow.
Limitations of Async:
- Does not pass data back to the main flow
- Is not called by a Flow Reference component.
- Is not reusable
- Does not inherit the exception strategy of the main flow
To handle Error in async scope you can use the Try Block
Configure the listener and drag and drop the Async activity
In the below scenario we will insert the Data in table and same data will write into file using async.
You can also defined the max concurrency with Async block
Deploy the project and test from soapui
Data Inserted successfully in table
File has written under test directory
Sample Application:Async Scope Sample
Sample Soap UI Project: Async scope sample soapui project