Salesforce Certified MuleSoft Developer Practice Questions

Salesforce Certified MuleSoft Developer exam preparationAligned with the official Exam Guide (Spring '24 release; guide version 13)

Salesforce Certified MuleSoft Developer practice questions in English: 180 questions with explanations. The mock exam has 60 questions and 120 minutes.

Salesforce Certified MuleSoft Developer free question 10 / 10 · Domain 9: Routing Events

A flow sets the payload to [4, 5, 6] and then reaches a Round Robin router with two routes. Route 1 holds a Set Payload of #[sizeOf(payload)]. Route 2 holds a Set Payload of #[payload map ($ 10)]. A Logger after the router prints the payload. The application has just started, and this is the first event that reaches the router. What does the Logger print?

  1. Either 3 or [40, 50, 60], depending on which route finishes first
  2. 3, because the first route runs first and its changes carry on
  3. [4, 5, 6], because what a route changes stays inside that route
  4. An object that holds the messages returned by both routes, keyed by route
Show the answer and explanation

Answer: B

Why this is correct
Round Robin contains two or more routes but executes only one of them each time the flow reaches it. The page says that the first time Round Robin executes, the component selects the first route, and that the router keeps track of the previously selected route and never selects the same route twice in a row. For this first event, route 1 runs: sizeOf([4, 5, 6]) sets the payload to 3. Any changes to the Mule event within a route propagate to the processor after Round Robin, so the Logger prints 3. The router is a way to spread events over routes in turn, not a way to send one event down several routes.

Why the other options are wrong
"[4, 5, 6], because what a route changes stays inside that route" … Changes do not stay inside the route. The page says any changes to the Mule event within a route propagate to the processor after Round Robin, so the Logger sees the payload that the route set.
"An object that holds the messages returned by both routes, keyed by route" … Only one route runs. Round Robin executes only one of the routes each time the flow executes the component, so there is no second message to combine with the first.
"Either 3 or [40, 50, 60], depending on which route finishes first" … The routes do not race. Round Robin runs one route per execution, and the first time it executes, it selects the first route, so the result does not depend on timing.

The next event takes the next route
The second event would take route 2 and the Logger would print [40, 50, 60]; after the last route, Round Robin goes back to the first. Because the payload, variables, and attributes that reach the router are available inside the route, each route can be written as a complete branch of its own.

Go to the Salesforce Certified MuleSoft Developer practice app (10 free questions; purchase unlocks all questions)

See the full practice set