What is the correct syntax to add a customer ID as a URI parameter in an HTTP Listener's path attribute?Show answerHide answer
Correct answer: B {customerlD}
Explanation
Explanation:URI Parameter Syntax: When defining an HTTP Listener's path in Mule 4, URI parameters (also known as path parameters) are defined using curly braces ({}) around the parameter name.
Example: If the Listener path is set to /accounts/{customerID}, a request to /accounts/12345 will be accepted.
Accessing the Parameter: The value of the URI parameter (12345 in the example) is then automatically extracted and made available in the Mule event as an attribute under attributes.uriParams.customerID.
β Incorrect Answers and Reasoning
A. (customerID): Parentheses are not the correct syntax for defining URI parameters in a Mule HTTP Listener path. This syntax is not used for this purpose in Mule.
C. #[customerID]: The #[...] syntax is used for DataWeave expressions to dynamically access variables, payloads, or attributes during message processing (runtime). It is not the correct way to define a path parameter in the Listener's configuration.
D. ${customerID}: The ${...} syntax is used for Mule Configuration Properties (placeholders) that are resolved when the application starts up. This is used for defining environment-specific values (like ports or credentials) from a properties file, not for defining variable parts of a request URI.
π References
MuleSoft Documentation on HTTP Listener: "The path parameter is defined by enclosing its name in curly braces (e.g., /users/{id}) in the Listener's path configuration."
MuleSoft Documentation on URI Parameters: "URI parameters are accessible in a flow using the DataWeave expression attributes.uriParams."
What DataWeave expression transforms the conductorIds array to the XML output?
Letβs break it down:

