MuleSoft Parallel ForEach Processor vs. ForEach Processor
This video tutorial details the MuleSoft Parallel ForEach processor and compares it to the ForEach processor.
Join the DZone community and get the full member experience.
Join For FreeIntroduction
Parallel ForEach allows you to process the collection of messages by splitting the collection into parts that are simultaneously processed in separate routes. Once all the messages has been processed, the results is aggregated in same order as they split before and flows continues.
Attributes |
Description |
Collection (collection) |
Specifies the expression that defines the collection of parts to be processed in parallel. By default, it uses the incoming payload. |
Collection Expression (collection) |
An expression that returns a collection. By default, the payload is taken as the collection to split. |
Timeout (timeout) |
Specifies the timeout for each parallel route. By default, there is no timeout. |
Max Concurrency (maxConcurrency) |
Specifies the maximum level of parallelism for the router to use. By default, all routes run in parallel. |
Target Variable (target) |
Specifies a variable to use for storing the processed payload. |
Target Value (targetValue) |
Specifies an expression to evaluate against the operation’s output value. |
Parallel ForEach vs. ForEach
ForEach |
Parallel ForEach |
ForEach processes message sequentially |
Parallel For Each process the messages in parallel. |
ForEach execution stopped, when an error is raised. |
Parallel ForEach execute all routes before raising error of type MULE:COMPOSITE_ROUTING |
ForEach doesn’t modify the original payload. |
Parallel For Each outputs a collection of the output messages from each iteration. |
ForEach [Videos]
Parallel ForEach [Videos]
Now, you know the difference between ForEach V/S Parallel ForEach.
Opinions expressed by DZone contributors are their own.
Comments