Multiple Choice Questions Flashcards

1
Q

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?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

According to MuleSoft what is the first step to create a modern API for use in an application

A

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.

http://workshop.tools.mulesoft.com/modules/module1#:~:text=Mulesoft%20advocates%20for%20users%20to,prior%20to%20the%20development%20effort.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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

A

Answer is

B. /accounts/{ID}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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?

A

Answer is A: The entire json payload with the date added to it, returned to web client and written to the file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

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

A

D. APP:API RESOURCE NOT FOUND

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

An event contains a payload that is an Array of Objects. How is the event routed in a Scatter-Gather?

A

B. The ENTIRE event is sent to each route and processed in PARALLEL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

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?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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?

A

Cant Find answer for this yet

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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. A global element

Explanation

The configuration file’s location needs to be specified as a global element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what is the output type of the dataweave map function?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

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?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

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?

A

Correct Answer: B. 100

Explanation/Reference:
https://docs.mulesoft.com/studio/7.4/mule-debugger-view-reference

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

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?

A

/stores/23?store_id=23&department=”pharmacy”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

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”

A

D. “String”

Ran mockup and it came back as String.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is the corect way to format the decimal 20.3844 as a string to two decimal places?

A

A. 20.3844 as String {format: “.0#”}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

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

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

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?

A

B. payload filter $.price < 500 orderBy $.price groupBy $.toAirport

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

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?

A

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/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

In a Mule application, what is the key process to enable manual watermarking for requests to a database using the Scheduler endpoint and the Database SELECT operation?

A

B. Save the max recordID from the set of recordIDs in an ObjectStore and reference this recordID in subsequent database requests

26
Q

This RAML file genearates an error.

What needs to be done to make this valid RAML?

A

C. Indent the get method under the [flight_id} resource

27
Q

web client submits a request to http://localhost:8081/books/0471767840. The value “0471767840” is captured by a Set Variable transformer to a variable named bookISBN.

What is the valid DataWeave expression to access the bookISBN variable later in the flow?

A

The correct answer to this question is

A. vars.bookISBN

Explanation

To access a value of any flow variable, it is necessary to use “vars.” before the name of the variable.

28
Q

The input array of strings is passed to the batch job, which does not do any filtering or aggregating.

What payload is logged by the Logger component?

A

Answer C. Summary report of processed records

Ran mockup to get this answer

29
Q

A Batch Job scope has three batch steps. An event processor in the second batch step throws an error because the input data is incomplete. What is the default behavior of the batch job after the error is thrown?

A

B. Stops processing entire batch job.

30
Q

In this Mule application files are written from inside a For Each scope.

What is written to the file system when the flow executes, and what payload is returned in the response to the web client?

A

Still looking up this answer but leaning toward

C. Two files are created, each containing a different array of one or two accounts

The response payload is a json formatted object of account objects that is created in the Set Payload transformer

Ran a mockup for this to try to simulate this. Sure its C.

31
Q

In this Mule application what value must be used in the input Parameters field of the database insert operation to properly pass the order record values to the SQL statement?

32
Q

According to Mulesoft, what organization sructure could have saved the development team two months of development time?

A

C. Center for enablement

33
Q

What can be added to the flow to persist data across different flow executions?

A

B. Key/value pairs in the ObjectStore

Explanation

The mechanics to store and share/read data between different Mule app executions is the ObjectStore.

34
Q

A Scatter-Gather processes three seperate HTTP requests. Each request returns a Mule event with a JSON payload?

What is the final output of the Scatter-Gather?

35
Q

A Mule application has been deployed to CloudHub and now needs to be governed. IT will not allocate additional vCores for a new Mule application to act as an API proxy.

What is the next step to preserve the current vCore usage, but still allow the Mule application to be managed by API Manager?

A

C. Modify the API implementation to use auto-discovery to register with API Manager

Explanation

After a Mule app (an API implementation) has been deployed, it is possible to create a proxy for it, but the proxy would use an additional vCore. In case that it is not wanted to use separate vCore allocations for the API proxy, it is possible to modify an implementation to use something MuleSoft calls auto-discovery to register the app with API Manager, to be able to govern it as there was na API proxy.

36
Q

What HTP method in a RESTful web service is generally recommended to be used to completely replace an existing resource?

A

B. PUT

37
Q

A Mule application contains two HTTP Listeners, each configured for different API endpoints:
http://acme.com/apis/orders and http://acme.com/apis/customers. What base path value should be set in an HTTP Listener config element so that it can be used to configure both HTTP Listeners?

A

C. /apis/

Explanation

Each HTTP Listener has an HTTP Listener configuration. In the HTTP Lister configuration, there is an option to define a base path, which is going to be a part of the URL located between host:port and the path from HTTP Listener property.

38
Q

DataWeave code needs to be written to transform the input payload to the output payload.

What is valid DataWeave code to perform this transformation?

A

employees : employee: @( firstName: payload[0].employee1.firstName[0], lastName: payload[0].employee1.lastName[0] ) : null

Have to do this one myself in Dataweave

39
Q

A Mule application has an HTTP Request that is configured with hardcoded values. To change this, the Mule application is configured to use a properties file named config.yaml. What valid expression can the HTTP Request host value be set to, so that it is no longer hardcoded?

A

A. ${training.host}

According to the Mulesoft syntax, the answer is A. Remember, when using global configuration properties, always use the syntax with a dot, dollar sign and curly braces.

40
Q

What is the minimum number of global elements that must be defined to support all these HTTP Listeners?

A

B. 2

Found one posible answer to this question but uncertain. Will have to set up a mock example for this.

Explanation

HTTP Listener can be configured to accept more than one method, but it can not accept more than one port or path.

41
Q

An API specification is defined using RAML.

What is the next step to create a REST connect connector from this specification?

A

A. Publish the API specification to Anypoint Exchange

42
Q

Refer to the exhibit. how many private flows does APIkit generate from the RAML specification?

A
43
Q

A RAML example fragment named BankAccountsExample.raml is placed in the examples folder in an API specification project.

What is the correct syntax to reference a fragment in RAML?

A

A. examples: !include examples/BankAccountsExample.raml

44
Q

The mule application contains a choice router.

What is logged when the flow completes?

A

B. “US”

Explanation

In the Choice router, the first expression that evaluates to true, triggers that route’s execution and the other routes will not be checked. In this case, since the payload is not empty, the first route is being executed and the payload is being set to “US”, so the correct answer is B.

45
Q

What URI does Mulesoft recommend to uniquely access the customer identified with the unique ID 1234?

A

D. /customers/1234

Not sure if this is correct answer above. This is what I think is true but according to Quizlet C. /customers/custid=1234 is the correct answer. have to do more research.

https://developer.mulesoft.com/tutorials-and-howtos/dataweave/how-to-retrieve-custom-headers-query-uri-parameters-dataweave

https://dzone.com/articles/understanding-the-uri-param-and-query-param-with-r

46
Q

The expression for the Choice router needs tom be written.

What is the valid expression to route Mule events to the non-default flow?

A

C. #[‘MuleSoft’ = = payload.’company’]

Explanation

In order to ask a question, it is necessary to use a logical operator. In this case it is an “==” and not “=”, which is an assignment operator. That eliminates answers A and B. Answer D is eliminated because of the “if”, since the Choice component asks for the condition written without it, which leave us C as the correct answer.

47
Q

The /dailly folder exists, is currently empty and files can be read and written to this folder by Anypoint Studio.

The Mule application is run in Anypoint Studio and then a file named productUpdate.txt containing the text “START” is written to the /daily folder.

What is in the /daily folder after the readUpdates flow completes for the first time?

A

A. A file named productUpdates.txt.bak containing the text “START’

Ran a mock up to get this answer

48
Q

In an application network, the implementation, not the interface, of a product API is being changed.

Does anything else need to be changed in the other APIs that consume the application?

A

A. Nothing needs to be changed in the other APIs or their associated applications

Explanation

The whole point of the application network architecture is to decouple functionality from the interface. That is exactly why APIs are being used, so that nothing would need to be changed in the applications that consume that updated application (or just the API, as many call it).

As long as the interface (API) of the application stays the same, other applications “know” what to expect from that API, so in this case, there would be no need to do anything.

49
Q

A flow contains a Database Select operation followed by an HTTP Request operation. The flow must combine and return data received from these two connector operations.

What is the method to capture both payloads so the payload from the second request does not overwrite that from the first?

A

B. Save the payload from the Database SELECT operation to a variable

Explanation

The Database SELECT operation is going to store its result in the payload. The HTTP Request operation is going to store its response in the payload as well. To avoid overwriting the payload, before making the HTTP Request we have to store the content of the payload into a variable.

That way, after the HTTP Request operation, we will have return data from two different data sources (variable and payload) and we can use “Transform Message” to combine those two sets of data into one.

50
Q

Where must the global error handler be specified so that it catches all errors from flows that do not have their own error handlers?

A

B. In a global element

51
Q

A Mule project contains a MySQL dependency.

The project is exported from Anypoint Studio so it can be deployed to Cloudhub.

What export options create the smallest deployable archive that will be successsfully deploy to CloudHub?

A

D. Include project modules and dependencies

Explanation

Since the Mule app has a dependency, it is necessary to include project modules and dependencies to make sure the app will run successfully on the runtime on any other machine.

Source code of the component that the Mule app is dependent of does not need to be included in the exported JAR file, because the source code is not being used while executing an app. Compiled code is being used instead.

https://help.mulesoft.com/s/question/0D52T000057MJ4iSAG/is-it-neccessary-to-attach-project-sources-to-create-the-smallest-deployable-archive-to-successfuly-deploy-to-cloudhub

52
Q

The Mule application does not define any global error handlers.

The validation component in the private flow throws an error.

What response is returned to a client request to the main flow’s HTTP Listener?

A

D. “Success-main flow”

53
Q

The API specification supports searching for articles on the searchworld.org site.

A

C. https://www.searchworld.org/s/api.php?action=search&query=einstein&format=xml

Auth header must also be included in request

54
Q

The RAML specification defines a way to create users.

What is the correct way to create a user in a web client?

A

D.

55
Q

The main flow contains an HTTP Request. The HTTP Listeners and HTTP Request use default configurations.

A web client sends a GET request to the main flow’s HTTP Listener that includes a modelName query paameter.

What value(s) are accessible in the child flow?

A

D. The payload

Ran mockup and if you are using HTTP Request only payload is accesible in child flow and is only thing that is returned to parent flow.

56
Q

The mule application does not have any global error handlers.

A web client sends an HTTP POST request to the HTTP Listener and the Validation component in the Try scope throws an error.

What response message is returned to he web client.

57
Q

A Mule application uses the ${http.port} property placeholder for its HTTP Listener port when it is deployed to ClloudHub.

What benefit does this Mule application configuration enable?

A

C. Allows CloudHub to automatically change the HTTP port to allow external clients to connect to the HTTP Listener

Explanation

According to MuleSoft, instead of using static values for your Mule application configurations, such as connections, you can create a .yaml or a .properties file to contain your properties and then reference the properties from your application.

Configuring a properties file improves the organization and maintainability of your applications.

If you use Anypoint Connector for HTTP (HTTP Connector), define the host address in the CloudHub configuration as 0.0.0.0. CloudHub routes requests from your application domain URL to the endpoint. If you deploy multiple workers, CloudHub load-balances incoming traffic automatically across the workers for you. As your application scales, work loads automatically distribute between your workers.

If your application requires an externally accessible HTTP or HTTPS port to receive messages, trigger events, or expose a web service or user interface, declare the HTTP Listener port using the reserved property ${http.port} or ${https.port}. On CloudHub, port ${http.port} or ${https.port} is assigned automatically by the platform services. Traffic on port 80 to your application domain’s URL is routed to ${http.port} and traffic on port 443 is route to ${https.port}.

To support routing to multiple CloudHub services over this port, you need to configure each with unique paths on the URL that is exposed. For example:

http: //0.0.0.0:${http.port}/service/path/one
http: //0.0.0.0:${http.port}/service/path/two

https://docs.mulesoft.com/runtime-manager/developing-applications-for-cloudhub

https://docs.mulesoft.com/runtime-manager/cloudhub-networking-guide#load-balancing

58
Q

The main flow contains a Flow Reference for the child flow.

After a web client submits a request to http://localhost:/8081/order?color=red, what values ae accesible in the child flow?

A

B. The payload, the color query parameter and the model variable

Explanation

Since the child flow is being called by using a flow reference, payload, query parameters and variables from the main flow are accessible in the Logger in the the child flow.

59
Q

A client submits a GET request to a Mule 4 application to the endpoint /customers?id=48493

Where is the ID stored in the Mule event by the HTTP Listener?

A

B. Attributes

60
Q

What payload is returned by an Anypoint Connector for Database’s Select operation that does not match any rows in the database?

A

D. An empty array

Explanation

It is a simple fact of the architecture of the Database Select processor and the fact that we at FoMS have recreated the app and empirically proved that in this case it returns an empty array indeed.

61
Q
A
62
Q
A