In Mule 4, what is the key difference between Set Variable and Set Property?

Prepare for the MuleSoft Developer 2 Certification Exam. Access practice quizzes featuring flashcards and multiple choice questions with explanations. Get confident and ready for your certification success!

Multiple Choice

In Mule 4, what is the key difference between Set Variable and Set Property?

Explanation:
In Mule 4, think about scope and purpose: Set Variable creates a flow variable that lives with the message only inside the flow where it was created. It’s convenient for carrying values along the steps of that flow, but it doesn’t cross flow boundaries and isn’t part of the message metadata that transports can rely on. Set Property, on the other hand, writes a piece of message metadata (a property) that travels with the message as it moves through transports and components. These properties are available across the route and can influence transport behavior or be used by downstream processors, not just within a single flow. So the best choice reflects that distinction: a flow variable is local to the flow, while properties persist as metadata accessible to transports and other components. The other options mix up persistence and scope: flow variables don’t persist across transports, properties aren’t limited to a single flow, and properties aren’t simply the payload.

In Mule 4, think about scope and purpose: Set Variable creates a flow variable that lives with the message only inside the flow where it was created. It’s convenient for carrying values along the steps of that flow, but it doesn’t cross flow boundaries and isn’t part of the message metadata that transports can rely on.

Set Property, on the other hand, writes a piece of message metadata (a property) that travels with the message as it moves through transports and components. These properties are available across the route and can influence transport behavior or be used by downstream processors, not just within a single flow.

So the best choice reflects that distinction: a flow variable is local to the flow, while properties persist as metadata accessible to transports and other components. The other options mix up persistence and scope: flow variables don’t persist across transports, properties aren’t limited to a single flow, and properties aren’t simply the payload.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy