mcd-level-1 question 189 discussion

View all MuleSoft Certified Developer - Level 1 (Mule 4) Exam here
back to mulesoft forum

Question 189

Refer to the exhibit.

The default scope in choice router recursively calls the color flow.
A web client sends a PUT request to the HTTP listener with payload Blue.
What response is returned to the web client?

  • A. "Blk"
  • B. "Green"
  • C. A timeout error Most Votes
  • D. ["Blue", "Red", "Blk"]
Answer:

C


Explanation:
Sequence can be described as follows.
* When web client sends the request , it sends payload as Blue (mentioned in question)
* In first iteration this will go to default choice , which sets payload to Red
* Via default route , flow will call itself with payload as Red
* In second iteration , as payload is Red , it will go to first route in choice router which will set
payload to Blk and second iteration will end returning back payload as Blk to first iteration.
* This Blk will be again set to payload and first iteration will end returning back response as Blk

User Votes:
A 5 votes
50%
B 2 votes
50%
C 10 votes
50%
D
50%
Discussions
0 / 1000
a.krishnaveni
1 year ago

nitial call:

Payload is set to "Blue".
Default case: Payload is set to "Red", and color flow is called recursively.
First recursive call:

Payload is set to "Blue" again.
Default case: Payload is set to "Red", and color flow is called recursively.
Second recursive call:

Payload is set to "Blue" again.
And so on...
Conclusion:
Since the payload is reset to "Blue" on each recursive call, this creates an infinite loop where the payload never advances past the initial setting of "Blue". This infinite recursion would ultimately result in a timeout error.

Thus, the correct response returned to the web client remains:

C. A timeout error

examgo
2 months ago

set payload "Payload default Blue" mens set payload to "Blue" if incoming payload is null. Since second time the payload is "Red" which is not null, the first choice gets executed and the payload will be set to "Blk".

franbernys
1 month, 3 weeks ago

A is the correct response because only in the first execution the payload is "Blue" look at the text "default", at the second execution the payload is set by the first execution (Red)