BookatlasTwo-Day MuleSoft → Salesforce Bootcamp
185 / 1048 · Module 6 — Mule Routing and Orchestration← prev⊞ allnext →

6.16Scatter-Gather

This is another key component.

Suppose one incoming request needs information from three independent systems:

                 ┌→ Salesforce
Request → Mule ──┼→ Billing API
                 └→ Customer Preferences API

Then combine the answers.

That's exactly the kind of problem Scatter-Gather solves.

Conceptually:

const [salesforce, billing, preferences] =
    await Promise.all([
        getSalesforce(),
        getBilling(),
        getPreferences()
    ]);

return combine(...);

Mule's Scatter-Gather router sends the event to multiple routes in parallel and aggregates their results. (docs.mulesoft.com)