Multiple Choice Questions Flashcards
The Set Payload transformer’s value is set to {‘year’: ‘2020’}. What message value should be added to the Logger component to output the message ‘The year is 2020’, without hard-coding 2020?
The correct answer to this question is D.
Explanation
First you should notice that the property “year” is a string, not an integer, which could be important in a case of concatenation. The answer C is wrong because of the dollar sign, which could be used only if you would want to access something from the global configuration file. Answer B is eliminated because of the usage of the mathematical addition operator “+”. Answer A is the tricky one. It almost looks good, especially if you take into consideration that the property “year” is a string, which could easily lead you to the conclusion that this concatenation would make sense. Nevertheless, it is wrong, because the whole expression “The year is ++ payload.year” is written as a string and that is exactly what would be the output of the logger. Three eliminated answers lead us to the answer B as the correct one.
Function named newProdCode needs to be defined to accept two input parameters, an integer value for itemID and a string value for productCategory, and to return a new product code. What is the correct DataWeave code to define the newProdCode function?
The correct answer to this question is B.
Explanation
To define a function in DataWeave the following syntax has to be used: fun myFunction(param1, param2, …) = “code to execute”
That leads us to the correct answer B.
According to MuleSoft what is the first step to create a modern API for use in an application
A. Create an API specification and get feedback from stakeholders
MuleSoft advocates for users to adopt a “design first” approach to creating API’s. A “design first” approach is used to enable API consumers the ability to understand, interact, and solicit feedback on the proposed API contract prior to the development effort.
The main flow of this module application uses an http connector operation and two jms connector operations.
The mule application is run and starts successfully, and then a local web client sends a request to http://localhost:8081/.
What payload is the returned to the web client from the Mule Application?
A. 1
B. 2
C. 3
D. 4
Answer: C. 3
Ran mockup and thats what I got
Cant find the answer for this question at this time. Think is D.
A web client sends a GET request that includes a destination query parameter to the flow’s HTTP Listener. The Web Service Consumer throws a WSC:BAD_REQUEST error.
What is the next step to fix this error?
A. Set a header in the Consume operation equal to the destination query parameter
B. Set a SOAP payload before the Consume operation that contains the destination query parameter
C. Set a property in the Consume operation equal to the destination query parameter
D. Set a JSON payload before the Consume operation that contains the destination query parameter
Answer is B.
Set a SOAP payload before the Consume operation that contains the destination query parameter
Explanation
Consume is a SOAP processor. There is a message in the console, that discovers the cause of an error. If the body is not a valid XML (SOAP envelope), or if the request cannot be created for some other reason (according to Mulesoft), you get a WSC:BAD_REQUEST error.
https://docs.mulesoft.com/web-service-consumer-connector/1.5/web-service-consumer-consume
An HTTP Request operation sends an HTTP request with a non-empty JSON object payload to an external HTTP endpoint. The response from the external HTTP endpoint returns an XML body. The result is stored in a target named the Result. What is the format of the payload that is input to the next event processsor after the HTTP Request?
The correct answer to this question is C.
Explanation
Since the response is being stored in the variable Result, the original payload in the flow has not been changed. Therefore the answer is C.
An HTTP Listener is being configured to accept requests from web clients on urls http://localhost:8081/accounts/10, where the number 10 can change to other numbers. In order to capture the number in a parameter named id to what must the path of the http
Answer is
B. /accounts/{ID}
The main flow contains an HTTP request in the middle of the flow. The HTTP Listeners and HTTP Request use default configurations. After a web client submit a request to http://localhost:8081/order?color=red, what are the values to the logger at the end of the main flow?
The correct answer to this question is
C. Payload and quantity var
Explanation
Since the child flow is being called by using the HTTP Request component, query parameters are going to be replaced by new query parameters or none if there are none. At the end, value of payload and flow variables are kept the same in the Logger in the main flow.
When the flow executes the now function() in the transform message component returns “2021-08-26T 13:32:10.64-07:00”.
What is written to the records.csv file when the flow executes?
Answer is A: The entire json payload with the date added to it, returned to web client and written to the file.
The main flow is configured with three error handlers. A web client submits a request to the HTTP listener and the HTTP request throws an HTTP:NOT_FOUND error.
What response is returned?
A. Success - main flow
B. HTTP: Not found
C. Other error
D. APP:API RESOURCE NOT FOUND
D. APP:API RESOURCE NOT FOUND
An event contains a payload that is an Array of Objects. How is the event routed in a Scatter-Gather?
B. The ENTIRE event is sent to each route and processed in PARALLEL
A Utility.dwl file is located in a Mule project at src/main/resources/modules. The Utility.dwl file defines a function named pascalize that reformats strings to pascal case.
What is valid DataWeave code to call the pascalize function in a trasform message component?
D. import modules::Utility
Utility::pascalize(“max mule”)
Have to look this one up furthur, could not find answer.
https://docs.mulesoft.com/dataweave/2.4/dataweave-create-module
The error occurs when a project is run in Anypoint Studio. The project, which has a dependency that is not in the MuleSoft Maven repository, was created and successfully run on a different computer. What is the next step to fix the error to get the project to run successfully?
The correct answer to this question is A.
Install the dependency to the computer’s local Maven repository
Explanation
As the error said, the dependency for the Mule project is missing, so installing to the computer’s local Maven repositories, solves the problem.
The Set payload transformer in the For Each scope and the Set Payload trasnformer in the batch job scope’s Batch Step Scope each contain an DataWeave expressiion to sleep for the number of milliseconds in the curent payload. The batch job scope’s block size is set to 1. In what order are the payloads logged in the for each scope and in the Batch Step scope?
Cant Find answer for this yet
To avoid hard-coding values, a flow uses some property placeholders and the corresponding values are stored in a configuration file. Where does the configuration file’s location need to be specified in the Mule application?
A. A global element
Explanation
The configuration file’s location needs to be specified as a global element
what is the output type of the dataweave map function?
B. Array
The map operator is a function in Dataweave which iterates over the items in an array and outputs them into a new array. It basically accepts input as a list of items in an array and manipulates the items in the array in order to form a new array as an output.
An SLA based policy has been enabled in the API Manager. What is the next step to configure the API proxy to enforce the new SLA policy?
The correct answer to this question is
D. Add required headers to the RAML specification and redeploy the new API proxy
Explanation
API proxy consumes RAML definition to enable SLA-based policies. Since a new policy has been created, it is necessary to change the RAML definition file as well, which then leads us back to the API proxy that needs to read the RAML file again, to become aware of the new SLA policy and to enforce it.
The orders.csv file is read and then processed to look up the orders in a database. The Mule application is debugged in Anypoint Studio and stops at the breakpoint.
What payload is shown in the debugger at this breakpoint?
Correct Answer: B. 100
Explanation/Reference:
https://docs.mulesoft.com/studio/7.4/mule-debugger-view-reference
A shopping API contains a method to look up store details by department.
According to this RAML specification, what is a valid URL for a web client to submit a GET request for details about the pharmcy department at the store with storeid 23?According to this RAML specification, what is a valid URL for a web client to submit a GET request for details about the pharmcy department at the store with storeid 23?
/stores/23?store_id=23&department=”pharmacy”
Refer to the exhibits. A web client submits a request to http://localhost:8081/flights. What is the result at the end of the flow?
A. “XML”
B. “Java”
C. “Object”
D. “String”
D. “String”
Ran mockup and it came back as String.
What is the corect way to format the decimal 20.3844 as a string to two decimal places?
A. 20.3844 as String {format: “.0#”}
Refer to the exhibits. The Mule application does not define any global error handler elements.
What is the response to a web client request to http://localhost:8081 ?
A. Validation Error
Explanation
This question is tricky, because the answer is not visible in the visual flow, but in the XML code.
As we can see in the code, if the payload is null, the flow will continue on the next component. If not, the “Validator” component is going to write “Validation Error” into the payload.
Since the payload is set in the first “Set Payload” component, it is not null anymore and it is going to be changed by the “Validator” component.
An event payload contains an unordered array of flight objects where every object has a price key and a toAirport key.
What is a valid DataWeave code to return flights with a price under $500, grouped by toAirport in ascending order, with the lowest price first?
B. payload filter $.price < 500 orderBy $.price groupBy $.toAirport
A web client makes an HTTP GET request to the flow’s HTTP Listener.
The validation component than throws an error with the message “Validate -Payload is an Integer”.
What response message is returned to the web client?
C. Validate - Payload is an Integer
Error occurs at the validation with message : Validate - Payload is an integer
Redirected to On Error Propagate(mind here, no payload will be set since error is being propagated not continued as no error), so no set payload value will be set, and the error message from validation will become error.description : Validate - Payload is an integer, which is set in HTTP Listener Responses Tab for default Error Response.
If there was On Error Continue scope with set payload component, the contents of set payload would have been the answer, since error is being continued as if no error has occurred.
Hence, the answer is C.
If in doubts , get a look of this awesome blog by Kyle Burke for Error Handling:
https://blogs.mulesoft.com/dev/training-dev/mule4-error-handling/