Contact Us 1-800-596-4880

Scatter-Gather (<scatter-gather/>)

logo cloud IDE Cloud IDE

logo desktop IDE Desktop IDE

Process a Mule event through two or more routes, and combine the results into a single event object.

Component XML

This component supports the following XML structure:

<scatter-gather doc:name="Scatter-Gather"
  doc:id="24d159a9"
  timeout="0"
  target="myTarget"
  maxConcurrency="10">
    <route >
      <!-- one or more processors here -->
    </route>
    <route >
      <!-- one or more processors here -->
    </route>
</scatter-gather>

Scatter Gather (<scatter-gather/>) attributes are configurable through the UI and XML.

Attribute Name Attribute XML Description

Scatter gather (default)

doc:name

Editable name for the component to display in the canvas.

N/A

doc:id

Automatically generated identifier for the component.

Timeout

timeout

Sets the timeout for responses from sent messages, in milliseconds. A value of 0 or less than 0 prevents a timeout. Defaults to 0.

Max concurrency

maxConcurrency

Sets the maximum number of routes to run concurrently.

By default, all routes run in parallel. Setting this value to 1 makes the component process the routes sequentially.

Collect list

N/A

N/A

Target Variable

target

Name of the variable in which you want to store message data. Names can only include numbers, characters, and underscores. For example, hyphens are not allowed in the name. See Enrich Data with Target Variables in the Mule documentation.

Target Value

targetValue

Value of the data to store in the target variable. By default, the value is the message payload (payload). The field accepts any value that a variable accepts: any supported data type, DataWeave expressions, the keywords payload, attributes, and message, but not the keyword vars. The default value is #[payload].

See Enrich Data with Target Variables in the Mule documentation.

<route/> is a child element of Scatter Gather.

Child Element Description

<route/>

Accepts one or more components as child elements for processing the Mule event. Multiple <route/> configurations are allowed.

Error Handling

This component can throw the following errors:

  • MULE:ROUTING

  • MULE:COMPOSITE_ROUTING

If you configure a timeout for this component and a route does not complete processing before the timeout expires, the route throws a MULE:TIMEOUT error. Mule handles this error as it handls other errors generated from a route: After each route completes (either by processing successfully or by throwing a MULE:TIMEOUT error), the successful results and errors are collected into the MULE:COMPOSITE_ROUTING error and then processed within a configured error handler component.