MULESOFT-DEVELOPER-I practice question 15 of 30
A flow needs to combine and return data from two different data sources. It contains a Database SELECT operation followed by an HTTP Request operation. What is the method to capture both payloads so the payload from the second request does not overwrite that from the first?
Full set: 235 questionsIn a Mule flow, each component that generates an output (like a Database SELECT or HTTP Request) typically places its result into the payload of the Mule event. When components are sequenced, the payload from a subsequent component overwrites the existing payload. To preserve the data from the first operation (Database SELECT), its payload must be stored in a variable before the second operation (HTTP Request) is executed. This allows the flow to access both the original database results from the variable and the new HTTP response from the payload.
A. A Cache scope is used for performance optimization by storing and reusing responses from previous identical requests, not for combining payloads within a single flow execution.
B. A Message Enricher scope is a valid way to do this, but it works by storing the result in a target variable, making "Save to a variable" the more fundamental and correct principle.
C. This is incorrect. By default, the payload from the second operation overwrites the payload from the first; they are not automatically combined.
1. MuleSoft Documentation, "Mule Message Structure". This document explains that the payload is the main body of the message and can be modified by components in the flow. (Accessed via MuleSoft's official documentation site).
2. MuleSoft Documentation, "Variables in Mule". This section details how variables are used to store data at different scopes within a Mule application, which is the mechanism for preserving data that would otherwise be overwritten in the payload. (Accessed via MuleSoft's official documentation site).
3. MuleSoft Documentation, "Set Variable Component". "Use the Set Variable component to create or update a variable. You can use variables to store information to use later in the flow." (Reference: docs.mulesoft.com/mule-runtime/4.4/set-variable-component).
Keep practicing
Take the free MULESOFT-DEVELOPER-I practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other MULESOFT-DEVELOPER-I practice questions
- Question 1How many Mule applications can run on a CloudHub worker?
- Question 4What does C4E stands for in MuleSoft recommended IT operating model?
- Question 16What of the below is not a feature of API Notebooks?
- Question 17What should this endpoint return? http://dev.acme.com/api/patients?name=John&surname=Bell
- Question 18An API has been created in Design Center. What is the next step to make the API discovera…
- Question 21Mule application contains ActiveMQ JMS dependency. Mule application was compiled and run …
