|Mulesoft / Mule EBS – Mule Flows Tutorial
In this mule ESB tutorial we will understand various mule flows in detail with downloadable examples.
|Various types of flows in mule
There are 4 types of flows in mule. While creating these flows the flow name should be unique in whole mule project despite beaning in different mule application XML file.
- Subflow always processes messages synchronously (relative to the flow that triggered its execution).
- Subflow executes in the same thread of the calling process. Calling process triggers the sub-flow and waits for it to complete and resumes once the sub-flow has completed.
- Subflow inherits processing strategy and exception handling strategy from the parent/calling flow.
Use – It can be used to split common logic and be reused by other flows.
Configuration – We have created 3 loggers in total, 2 in main/calling flow which is before and after flow reference and one in the sub flow.
Same as sub-flow, the only difference is that in synchronous flows you need to separately define an exception strategy to it, it does not inherit the exception strategy of its calling flow.
- As in sub-flow and synchronous flow, calling process triggers the sub-flow or synchronous flow and waits for it to complete; for asynchronous flow the flow, calling process triggers an asynchronous flow and moves ahead to its next activity.
- An asynchronous flow executes in parallel to its calling/parent flow in a different thread.
- An asynchronous flow does not return its output it its parent/calling flow.
1. We have created 4 loggers in total, 2 in main/calling flow which is before and after flow reference (inside Async flow calling a sub-flow) and one in the sub flow.
Since sub-flow inherits processing strategy and exception handling strategy from the parent/calling flow, the sub flow will execute asynchronously.
2. We have added a groovy script in the subflow to pause the thread executing it for 10 sec.
Flow that does not have an inbound connector in the source. Means a private flow cannot start of its own on receiving the inbound message as it does not have any inbound connector, A private flow can only be called using flow-ref same as sub-flow.