Question 31
Choose 1
In the execution of scatter gather, the "sleep 2 sec" Flow Reference takes about 2 sec to complete, and the "sleep 8 sec" Flow Reference takes about 8 sec to complete.
About how many sec does it take from the Scatter-Gather is called until the "Set Payload" transformer is called?

About how many sec does it take from the Scatter-Gather is called until the "Set Payload" transformer is called?

Correct answer:
A. 8
Explanation:
The key to understanding this question is how the Scatter-Gather router works in Mule 4.
Scatter-Gather Behavior: The Scatter-Gather executes all of its routes concurrently. It does not execute them sequentially. It starts all routes at the same time and then waits for all of them to complete before aggregating the results and moving on to the next processor in the main flow.
Execution Timeline:
Time = 0 sec: The Scatter-Gather starts. It immediately launches both the "sleep 2 sec" and "sleep 8 sec" routes at the same time.
Time = 2 sec: The "sleep 2 sec" route finishes its execution. The Scatter-Gather has one result but continues to wait for the other route.
Time = 8 sec: The "sleep 8 sec" route finishes its execution. Now that all routes are complete, the Scatter-Gather aggregates the results (if any) and proceeds.
Total Time: Therefore, the total time from when the Scatter-Gather is called until it finishes and the subsequent Set Payload processor is called is determined by the longest-running route. In this case, that is 8 seconds.
Why the others are incorrect:
B. 0: This is incorrect because both routes perform a sleep operation, which takes real time. The Scatter-Gather does not bypass or ignore the processing time of its routes.
C. 2: This is the duration of the fastest route, but the Scatter-Gather must wait for the slowest one.
D. 10: This would be the result if the routes ran sequentially (2 + 8), but the Scatter-Gather's primary feature is parallel execution.
Reference:
MuleSoft Documentation - Scatter-Gather Router. The documentation states: "The Scatter-Gather component executes a set of routes in parallel, then aggregates the results into a single message." Its execution time is bound by the slowest parallel route. This concept falls under the Controlling Message Flow (19%) domain of the exam guide.
The key to understanding this question is how the Scatter-Gather router works in Mule 4.
Scatter-Gather Behavior: The Scatter-Gather executes all of its routes concurrently. It does not execute them sequentially. It starts all routes at the same time and then waits for all of them to complete before aggregating the results and moving on to the next processor in the main flow.
Execution Timeline:
Time = 0 sec: The Scatter-Gather starts. It immediately launches both the "sleep 2 sec" and "sleep 8 sec" routes at the same time.
Time = 2 sec: The "sleep 2 sec" route finishes its execution. The Scatter-Gather has one result but continues to wait for the other route.
Time = 8 sec: The "sleep 8 sec" route finishes its execution. Now that all routes are complete, the Scatter-Gather aggregates the results (if any) and proceeds.
Total Time: Therefore, the total time from when the Scatter-Gather is called until it finishes and the subsequent Set Payload processor is called is determined by the longest-running route. In this case, that is 8 seconds.
Why the others are incorrect:
B. 0: This is incorrect because both routes perform a sleep operation, which takes real time. The Scatter-Gather does not bypass or ignore the processing time of its routes.
C. 2: This is the duration of the fastest route, but the Scatter-Gather must wait for the slowest one.
D. 10: This would be the result if the routes ran sequentially (2 + 8), but the Scatter-Gather's primary feature is parallel execution.
Reference:
MuleSoft Documentation - Scatter-Gather Router. The documentation states: "The Scatter-Gather component executes a set of routes in parallel, then aggregates the results into a single message." Its execution time is bound by the slowest parallel route. This concept falls under the Controlling Message Flow (19%) domain of the exam guide.

What is the correct syntax to add a customer ID as a URI parameter in an HTTP Listener's path attribute?