{{announcement.body}}
{{announcement.title}}

MuleSoft Parallel ForEach Processor vs. ForEach Processor

DZone 's Guide to

MuleSoft Parallel ForEach Processor vs. ForEach Processor

This video tutorial details the MuleSoft Parallel ForEach processor and compares it to the ForEach processor.

· Integration Zone ·
Free Resource

Introduction

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.

Topics:
foreach processor, integration, mulesoft, parallel foreach

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}