QuestionQ44

VerifiedMuleSoft application network concepts

A bank is implementing a REST API in a Mule application to accept an array of accounts from an online banking platform user interface (UI), obtain the account balances for those accounts from a backend Finance system, and return the account balances for display in the online banking platform UI. During processing, the MuleSoft API must also insert the retrieved account data into an Audit Database for auditing purposes. The auditing process must not introduce latency into the account-balance retrieval response returned to the online banking platform UI.

The retrieveBalances flow in the Mule application is designed to use an operation in a connector to the Finance system (the Finance operation) that can look up only one account record at a time, and an operation from a different connector to the Audit system (the Audit operation) that can insert only one account record at a time.

To best satisfy the performance-related requirements, which scope or scopes should be used, and how should they be used to incorporate the Finance operation and Audit operation into the retrieveBalances flow?

Explanation

A Parallel For Each scope splits the account collection into routes that can run concurrently, allowing the single-record Finance operation to retrieve multiple balances in parallel. An Async scope executes its work simultaneously with the main flow in a fire-and-forget branch, so the Audit operation can insert the retrieved records without making the UI response wait for auditing to finish.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!