Which MEL expression resolves environment properties in Mule 4?

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

Which MEL expression resolves environment properties in Mule 4?

Explanation:
This tests how to fetch environment-specific values using MEL. In Mule 4, the p() function is used to resolve environment properties at runtime, pulling the value of a named property from the current environment configuration. This lets the same flow run against different environments (dev, test, prod) without changing code. For example, using #[p('api.base.url')] will return the API base URL defined in the environment properties for the active environment. This is why the option that uses p('name') is the correct approach. The other ideas don’t fit because MEL isn’t limited to DataWeave for this task, environment properties aren’t typically read from a YAML file at runtime, and environment properties are indeed accessible at runtime.

This tests how to fetch environment-specific values using MEL. In Mule 4, the p() function is used to resolve environment properties at runtime, pulling the value of a named property from the current environment configuration. This lets the same flow run against different environments (dev, test, prod) without changing code.

For example, using #[p('api.base.url')] will return the API base URL defined in the environment properties for the active environment. This is why the option that uses p('name') is the correct approach.

The other ideas don’t fit because MEL isn’t limited to DataWeave for this task, environment properties aren’t typically read from a YAML file at runtime, and environment properties are indeed accessible at runtime.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy