MCD Level 1 - Part 2 Flashcards

1
Q

According to Mulesoft, how are Modern APIs treated as?

A

Modern API has three features 1) Treated as products for easy consumption 2) Discoverable and accessible through self-service 3) Easily managed for security , scalability and performance

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

What is the difference between a subflow and a sync flow?

A

Correct answer is Subflow has no error handling implementation where as sync flow has.
Using Flows
Flows can have Mule Sources (such as an HTTP listener receiving a request) that trigger the execution of a flow. For cases where you do not want a source to start a flow right away, you can configure your flow as initially stopped and start it later through Runtime Manager.

Like functions or methods in other programming languages, it is a best practice to focus your flows on specific (perhaps reusable) activities, such as receiving an API request from a web client, processing the event, then returning an appropriate response. If the event processing gets complicated, or must call out to other services, you might factor out that behavior into other flows.

Using Subflows
A subflow is a scope that enables you to group event processors in a manner similar to that of a flow, but with certain differences and limitations:
Subflows do not have event sources.
Subflows do not have an error handling scope.
During design, subflows work as macros that replace the Flow Reference components that call them.

When you build the application, all Flow Reference components that call a subflow are replaced by the contents of the referenced subflow.
Referencing subflows results in better performance than referencing a flow.

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

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

A

Object stores are used to store and persist the data across different flow executions.

Hence correct answer is Key/value pair in Object store

https://docs.mulesoft.com/runtime-manager/managing-application-data-with-object-stores

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

Mule application contains two HTTP Listeners, each configured for different API endpoints: http://trainingdemo.com/apis/orders and http: //trainingdemo.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:

/apis/* would match any path starting with “apis/” and any characters after that, which is more than what we need.
/apis/? wouldn’t work because the question specifies that the base path should be used to configure both HTTP Listeners, and this option only matches paths ending with a question mark.
/apis/orders|customers is too specific and wouldn’t work for other potential endpoints under the “/apis/” path.
Therefore, /apis/ is the most appropriate option because it:

Matches the common prefix of both desired endpoints (/apis/orders and /apis/customers).
Captures only the desired base path without unnecessary characters or wildcards.
Allows for flexibility to add additional endpoints under the “/apis/” path in the future without modifying the base path configuration.

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

As a part of requirement , application property defined below needs to be accessed as dataweave expression. What is the correct expression to map it to port value?

A

{ port : p(‘db.port’)}
In a DataWeave script you can reference an application property defined in a properties files by using the p function of the dw::Mule module. The module is imported by default.
So when using Dataweave expression to use the value used in application properties, it is correct syntax.

Please refer to the below link for Mulesoft documentation around this.
https://docs.mulesoft.com/mule-runtime/4.3/dw-mule-functions-p

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

What valid RAML retrieves details on a specific order by its orderId as a URI parameter?

A

Correct answer is below as it is the correct syntax
/orders:
/{orderId}:
get:

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

What is the correct DataWeave expression for the Set Payload transformer to call the createCustomerObject flow with values for the first and last names of a new customer?

A

Now as per lookup function syntax the first argument to this function is the name of the flow to be called and second argument is payload to be sent as a map.
Hence correct answer is.
lookup( “createCustomerObject”, {first: “Aice, last: “Green”})

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

A webclient submits the request to http://localhost:8081/flights?destination=SFO and the Web Service Consumer throws a WSC:BAD_REQUEST error. What is the next step to fix this error?

A

A webclient submits the request to http://localhost:8081/flights?destination=SFO and the Web Service Consumer throws a WSC:BAD_REQUEST error. What is the next step to fix this error?

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

Refer to the exhibit. The API needs to be updated using the company wide standard for the Plan data type. The Object data type has already been published to Anypoint Exchange with the global reference ACME/DataTypes/PlanData.raml . What is valid RAML specification that reuses the Plan Data type?

A

RAML keyword to use a reference is !include. Hence two of the options which contain referrence in plan field are incorrect as they contain the keyword reference instead of include.
Also references to data types are included under type field and not dataType field.
Hence correct answer is
#%RAML 1.0
title: ACME Telecom API
types:
Plan: !include ACME/DataTypes/PlanDataType.raml
/plans:
get:
responses:
200:
body:
application/json:
type: Plan[]
example: !include ACME/Examples/PlanExamples.raml

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

Refer to the exhibits. What expression correctly specifies input parameters to pass the city and state values to SQL query?

A

Correct syntax is as below. You can also get detail of such examples at below link
https://docs.mulesoft.com/db-connector/1.9/database-connector-examples
#[{
city: “San Fransisco”,
state: “CA”
}]

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

Refer to the exhibits. How many private flows does APIKIt generate from RAML specification?

A

APIKIt Creates a separate flow for each HTTP method. Hence 4 private flows would be generated

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

What is the correct syntax to define and and call a function in Dataweave?

A

fun addKV( object: Object, key: String, value: Any) = object ++ {(key):(value)} — addKV ( {“hello’: “world”}, “hola”, “mundo” )

Keyword to ad function in Dataweave transformation is fun. This makes two of the above options incorrect. Also parameters needs to be passed exactly in same order as defined in function definition.
Hence correct answer is
fun addKV( object: Object, key: String, value: Any) =
object ++ {(key):(value)}

addKV ( {“hello’: “world”}, “hola”, “mundo” )

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

A web client submits a request to http://localhost:8081?accountType=personal.The query parameter is captured using a Set Variable transformer to a variable named accountType. What is the correct Dataweave expression to log accountType?

A

vars: Keyword for accessing a variable, for example, through a DataWeave expression in a Mule component, such as the Logger, or from an Input or Output parameter of an operation. If the name of your variable is myVar, you can access it like this: vars.myVar
Hence correct answer is Account Type : #[vars.accountType]

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

What is correct syntax for a Logger component to output a message with the contents of a JSON Object payload?

A

Correct answer as as below it concatenates payload with String.
The payload is: #[payload]

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

. What DataWeave expression transforms the example XML input to the CSV output?

A

payload.sale.*item map {(value, index) -> { index: index, sale: value.@saleId itemName: value.desc, itemPrice: (value.price) * (value.quantity) item: value.@itemId

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

What is valid text to set the user field in the Database connector configuration to the username value specified in the config.yaml file?

A

Below is the correct answer as it adheres to the correct syntax to access application properties.
${db.username}

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

What is the output payload in the On Complete phase

A

This is a tricky question. On complete phase payload consists of summary of records processed which gives insight on which records failed or passed. Hence correct answer is
Summary statistics with No record data
Details can be found at below documentation
https://docs.mulesoft.com/mule-runtime/4.3/batch-processing-concept#on-complete

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

A flow contains an HTTP Listener as the event source. What is the DataWeave expression to log the Content-Type header using a Logger component?

A

Such questions are best solved with filtering mechanism

1) Concatenation is always with ++ sign and not with + sign which makes two of the options as incorrect

2) headers can be accessed with attributes.headers and not with only headers
Hence correct answer is
#[“Content-Type: ” ++ attributes.headers.’content-type’]

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

Refer to the exhibit. A web client submits a request to the HTTP Listener and the HTTP Request throws an error. What payload and status code are returned to the web client?

A

When HTTP Request throws an error, it goes in error handling section. Note here that On Error Continue scope is being used here is error flow. When On Error Continue scope is invoked, all the processors in error block are executed and success response is sent back to the client with payload which is set in error flow. In this case payload is set to “Error” value in error block. Hence it will be sent back to client with http code as 200 as On error continue always sends success error code. Hence correct answer is
Response body: “Error” Default response status code: 200

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

A RAML example fragment named StudentExample.raml is placed in the examples folder in an API specification project. What is the correct syntax to reference the fragment?

A

Correct answer is
examples: !include examples/StudentExample.raml
The !include tag takes a single argument: the location of the external file containing the property value. This location may be an absolute URL, a path relative to the root RAML file
A location starting with a forward slash (/) indicates a path relative to the location of the root RAML file, and a location beginning without a slash is interpreted to be relative to the location of the including file.

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

What module and operation will throw an error if a Mule events payload is not number

A

Correct answer is Validation modules Is Number operation.
This processor validates that a String can be parsed as a number of a certain type.

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

Note that private flow has error scope defined as On Error Continue . So when error occurs in private flow , it is handled by this On Error Continue scope which sends success response back to main flow and does not throw back an error. So main continues normally and payload is set to Success – main flow.
Hence correct answer is Success – main flow

A

Note that private flow has error scope defined as On Error Continue . So when error occurs in private flow , it is handled by this On Error Continue scope which sends success response back to main flow and does not throw back an error. So main continues normally and payload is set to Success – main flow.
Hence correct answer is Success – main flow

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

Refer to the exhibit. 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

As dependency is not present in Mulesoft Maven repository, we need to install the dependency on computer’s local Maven repository. Install the dependency to the computer’s local Maven repository is correct choice.

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

What values are accessible in the child flow after a web client submits a request to http://localhost:8081/order?color=red?

A

Correct answer is as below as all of it will be accessible in child flow.
payload
quantity var
color query param

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

A web client submits a request to http://localhost:8081?flrstName=Mahesh. What is the correct
DataWeave expression to access the firstName parameter?

A

Correct answer is below as it follows the required syntax
#[attributes.queryParams.firstName]

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

A mule project contains MySQL database dependency . The project is exported from Anypoint Studio so that it can be deployed to Cloudhub. What export options needs to be selected to create the smallest deployable archive that will successfully deploy to Cloudhub?

A

Correct answer is select the Include project modules and dependencies option. This option adds up bundling the actual modules and external dependencies required to run the Mule application in a Mule runtime engine. Attach Project Sources is an optional thing to include metadata that Studio requires to reimport the deployable file as an open Mule project into your workspace.

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

A Utlility.dwl is located in a Mule project at src/main/resources/modules. The Utility.dwl file defines a function named encryptString that encrypts a String What is the correct DataWeave to call the encryptString function in a Transform Message component?

A

Correct answer is the below one as it follows the correct syntax.
%dw 2.0
output application/json
import modules::Utility

Utility::encryptString( “John Smith” )

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

Refer to exhibits. A web client submits a request to http://localhost:8081. What the structure of the payload at the end of the flow?

A

Scatter-Gather sends the event to each routes concurrently and returns a collection of all results. Collection is an Object of Objects. Each object contains attributes and payload from each Mule event returned from a flow.
Hence correct answer is
[
“0”: {
“attributes”: —,
“payload”: “Banana”
}
“1”: {
“attributes”: —,
“payload”: “Banana”
}
]

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

Refer to the exhibits. The main flow contains an HTTP Request in the middle of the flow. The HTTP Listeners and HTTP Request use default configurations. What values are accessible to the Logger at the end of the main flow after a web client submits the request to http://localhost:8080/order?color=red?

A

In this case as outbound call is made using HTTP: POST /child , all attributes will be replaced by this invocation. Hence query parameter will not be accessible at logger. Hence correct answer is
payload
quantity var

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

Refer to the exhibits. What is valid expression for the Choice router’s when expression to route the events to the domesticShipping flow

A

Correct answer is #[payload == ‘US’] as this follows the correct syntax

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

Assume that you are invoking Mulesoft API using Postman tool. Mulesoft API follows standard HTTP status code conventions correctly. If service returns an error with HTTP code 401. What can be concluded from this response?

A

The HTTP 401 Unauthorized client error status response code indicates that the request has not been applied because it lacks valid authentication credentials for the target resource.

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

A web client submits a request to http://localhost:8081?accountType=personal. The query parameter is captured using a Set Variable transformer to a variable named accountType. What is the correct DataWeave expression to log accountType?

A

vars: Keyword for accessing a variable, for example, through a DataWeave expression in a Mule component, such as the Logger, or from an Input or Output parameter of an operation. If the name of your variable is myVar, you can access it like this: vars.myVar
Hence correct answer is Account Type: #[vars.accountType]

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

A Database On Table Row listener retrieves data from a CUSTOMER table that contains a primary key userid column and an increasing systemin_date_time column. Neither column allows duplicate values. How should the listener be configured so it retrieves each row at most one time?

A

You can set systemin_date_time column as watermark column in DB listener configuration as this field is increasing field.

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

The Database Select operation returns five rows from a database. What is logged by the Logger component?

A

Array is the correct answer as select DB operation returns array of objects

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

Refer to the exhibits. The two Mule configuration files belong to the same Mule project. Each HTTP Listener is configured with the same host string. Port number , path and operation values are shown in display names. What is the minimum number of global elements that must be defined to support all these HTTP Listeners?

A

In this case three configurations will be required each for port 8000, 6000 and 7000
Hence correct answer is 3

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

Refer to the exhibit . What is the correct syntax to add an employee ID as URI parameter in an HTTP Listener path

A

While configuring HTTP listener path , URI parameters are always enclosed within curly braces.
Hence correct answer is {employeeID}

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

What path setting is required for an HTTP Listener endpoint to route all requests to an APIKit router

A

Correct answer is /* as this is correct syntax to configure HTTP Listener endpoint

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

While configuring HTTP listener in Anypoint platform project in a flow , which of the following is NOT mandatory to be configured for getting the code compiled successfully?

A

Allowed methods for HTTP Listener is an optional field which can be used to restrict the HTTP method which will be accepted.
For e.g. If you define allowed method as POST and request is received with method PUT then request will be rejected with below error.
HTTP response with status code 405 Method Not Allowed.

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

Refer to the exhibits. The Batch Job processes, filters, and aggregates records. What is the expected outcome from the Logger component

A

Batch scope has filter criteria which says payload mod 2 = 0 which means only 2, 4 and 6 will be in batch scope. So payload for each of these will be incremented by 10. Aggregator has batch size defined as 2. So it will process in batch of two records.
Hence correct answer is
[20,40]
[60]

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

In the execution of the Scatter-Gather , the flow route completes after 10 seconds and the flow2 route completes in 40 seconds. How many seconds does it take for the Scatter-Gather to complete?

A

Scatter-Gather sends the event to each routes concurrently. Hence both route in this example will start in parallel. So total time to complete processing is 40 seconds which is the correct answer

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

What should the the first line of RAML API definition contain?

A

RAML specifications always start with the comment containing RAML version. Please find the sample below
#%RAML 1.0

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

What HTTP status code does the HTTP specification indicate to be returned when an unsupported value is sent in the Accept Header?

503

A

The HyperText Transfer Protocol (HTTP) 406 Not Acceptable client error response code indicates that the server cannot produce a response matching the list of acceptable values defined in the request’s proactive content negotiation headers, and that the server is unwilling to supply a default representation.
Proactive content negotiation headers include:
Accept
Accept-Charset
Accept-Encoding
Accept-Language

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

While creating notebook, what is the syntax of the first function call to generate a client to make calls to the API?

A

Syntax for createClient command is as below
API.createClient(alias, url, options? cb?)
alias :The name with which you call this client from now on (Required)
url :A URL that directs to the API’s RAML definition (Required)
options: A specification of default headers, a fallback body, or other option. Type the method in the notebook and place the cursor on this argument for more details. (Optional)
cb :Pass in a custom callback to run when the client has loaded (Optional)
Sample example is as below

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

Which of the following HTTP method should NOT be idempotent in nature?

A

HTTP methods are classified as following:
+———+——+——-
| Method || Idempotent |
+———+——+——-
| CONNECT || no |
| DELETE || yes |
| GET || yes |
| HEAD || yes |
| OPTIONS || yes |
| POST || no |
| PUT || yes |
| TRACE || yes |
+———+——+——-

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

What is true about RESTful API’s

A

As per the REST architecture, a RESTful Web Service should not keep a client state on the server. This restriction is called Statelessness. It is the responsibility of the client to pass its context to the server and then the server can store this context to process the client’s further request.

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

Which is NOT a valid fragment identifier in RAML 1.0?

A

Extension is the correct answer
API fragment is one of the following types defined by RAML.org.
Trait
Resource Type
Library
Type
User Documentation
Example
Annotation Type
Security Scheme

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

What is the correct way to specify queryParameter in RAML 1.0?

A

Correct syntax is
/flights:
get:
queryParameters:
destination:
required: false
enum:
– SFO
– LAX
– CLE

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

What language is used to create API Notebooks?

A

JavaScript is the correct answer as An API Notebook is a web-based tool for building interactive tutorials and examples in a JavaScript scripting workspace

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

What is the difference between a subflow and a sync flow

A

subflow has no error handling of its own and sync flow does

50
Q

Is a root element needed when creating a response using Dataweave?

A

Only needed for XMLs

51
Q

Where are values of query parameters stored in the Mule event by the HTTP Listener?

A

In Mule4 – #[attributes.queryParams.{paramaterName}]

52
Q

Where would you create SLA Tiers for an API

A

API Manager

53
Q

In the Database On Table Row operation, what does the Watermark column enable the On Table Row operation to do?

A

To avoid duplicate processing of records in a database

54
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

All processing of the batch job stops

55
Q

How are multiple conditions used in a Choice router to route events?

A

To find the FIRST true condition, then distribute the event to the ONE matched route

56
Q

What DataWeave 2.0 type can be used as input to a map operation?

A

Array

57
Q

Why would use SOAP instead of http

A

Successful/retry logic for reliable messaging functionality

58
Q

What is the object type returned by the File List operation?

A

Array of Mule event objects

59
Q

What asset can NOT be created using Design Center?

A

API Portals

60
Q

What is the correct syntax to reference a fragment in RAML

A

!include examples/BankAccountsExample.raml

61
Q

What does the minus minus operator do in DataWeave

A

Removes items from a list

62
Q

What does the zip operator do in DataWeave

A

Merges elements of two lists (arrays) into a single list

63
Q

What is a core characteristic of the Modern API?

A

API is designed first using an API specification for rapid feedback

64
Q

What statement is part of MuleSoft’s description of an application network

A

Creates reusable APIs and assets designed to be consumed by other business units

65
Q

What DataWeave 2.0 type can be used as input to a mapObject operation?

A

Object

66
Q

How is policy defined in terms of classloader of an API

A

Classloader isolation exists between the application, the runtime and connectors, and policies

67
Q

Where does a deployed flow designer application run in Anypoint Platform?

A

CloudHub worker

68
Q

How does Runtime Manager Console connect with App Data and Logs of a Mule app

A

Rest API

69
Q

What is the trait name you would use for specifying client credentials in RAML

A

client-id-required

70
Q

What is the main purpose of flow designer in Design Center?

A

To design and develop fully functional Mule applications in a hosted development environment

71
Q

A Set Variable component saves the current payload to a variable. What is the DataWeave parent expression to access the variable?

A

[vars]

72
Q

What is the DataWeave expression to log the Content-Type header using a Logger component?

A

[“Content-Type: “ ++ attributes.headers.’content-type’]

73
Q

What is the correct way to format the decimal 200.1234 as a string to two decimal places?

A

200.1234 as String {format: “.0#”}

74
Q

What is the purpose of API autodiscovery?

A

Allows a deployed Mule application to connect with API Manager to download policies and act as its own API proxy

75
Q

According to MuleSoft what is the Center for Enablement’s role in the new IT operating model

A

Creates and manages discoverable assets to be consumed by line of business developers

76
Q

What is NOT part of a Mule 4 event?

A

nboundProperties

77
Q

What happens to the attributes of a Mule event in a flow after an outbound HTTP Request is made?

A

Attributes are replaced with new attributes from the HTTP Request response

78
Q

What module and operation will throw an error if a Mule event’s payload is not a number?

A

Validation module’s Is number operation

79
Q

An API has been created in Design Center. What is the next step to make the API discoverable?

A

Anypoint Exchange enables publishing, sharing, and searching of APIs

80
Q

How can you call a flow from Dataweave?

A

Look up function

81
Q

How to import Core (dw::Core) module into your DataWeave scripts

A

not needed

82
Q

Anypoint MQ FIFO queues are limited to how many in flight messages per queue

A

10

83
Q

What does the Mule runtime use to enforce policies and limit access to APIs?

A

The Mule runtime’s embedded API Gateway

84
Q

What is the purpose of the api:router element in APIkit?

A

Validates requests against RAML API specifications and routes them to API implementations

85
Q

What are the latest specfification of RAML available

A

1

86
Q

What is the face of CloudHub and integrates with Platform Services

A

Runtime Manager Console

87
Q

DataWeave is tightly integrated with

A

Mule runtime

88
Q

What is the use of API Notebooks

A

Test API functions

89
Q

What are the features of CloudHub Fabric

A

Horizontal Scaling

90
Q

What is the use of DevKit in Mule 4

A

No use

91
Q

What is the minimum required configuration in a flow for a Mule application to compile

A

An event processor

92
Q

A Scatter-Gather processes a number of separate HTTP requests. Each request returns a Mule event with a JSON payload. What is the final output of the Scatter-Gather?

A

n Object containing all Mule event Objects

93
Q

Which one of them are flows in Mule

A

async flow
sync flow
subflow

94
Q

A value has been assigned to Set Variable. Under what scope does the value of assigned variable?

A

Mule Event

95
Q

Why the http.port is being set as variable or configurable in anypoint exchange?

A

So it can be Automatic reconfigured by the hosting server

96
Q

What is the correct way to fill in the Port value using config variable?

A

${http.port}

97
Q

Given the flow below. What is the expected payload at the logger? Note: with flatten method ___ [listener]-> [setpayload ({“Lunch”:”Adobo”,”Dinner”:”Kaldereta”})] -> [[scatter-gather] -> [set payload ({“FastFood”:”McDonalds”})] -> [set payload (payload”)] -> [logger]] -> [transform message (flatten)] -> [logger] ___

A

[{“FastFood”: “Mcdonalds”}, {“Lunch”: “Adobo”, “Dinner”: “Kaldereta”}, {“Lunch”: “Adobo”, “Dinner”: “Kaldereta”}]

98
Q

What is the final payload? ___ [listener] -> [[scatter-gather] -> [set payload (Banana)] -> [set payload (Apple)] -> [set payload (Orange)]] -> [logger] —— ___

A

{ 0: { attributes: {…} payload: “Banana” }, 1: { attributes: {…} payload: “Apple” }, 2: { attributes: {…}}

99
Q

You have created a global error handle what should be done to set it as the application’s default error handler.

A

Set it under global configuration elements on global.xml

100
Q

Refer to exhibit. The flow below is trying to consume a SOAP WebService but after deploying the application an exception was thrown as seen in the console below. ___ [listener (GET /flights)] -> [consume (listAllFlights)] -> [logger] ___ What to do next to fix the problem?

A

Set a SOAP input by adding Transform Message processor

101
Q

A msql dependency was added in Mule Project, what is the minimum deployable archive setting for the application to run in cloud hub?

A

nclude project modules and dependencies

102
Q

Given the following json input and xml output. What is the dataweave code that transform the json array to xml? ___JSON___ [{ “Airline”: “United”, “Accommodation”:”Economy” }, { “Airline”: “American”, “Accommodation”: “BusinessClass” }] ___ ___XML___ United Economy American BusinessClass ___

A

Given the following json input and xml output. What is the dataweave code that transform the json array to xml? ___JSON___ [{ “Airline”: “United”, “Accommodation”:”Economy” }, { “Airline”: “American”, “Accommodation”: “BusinessClass” }] ___ ___XML___ United Economy American BusinessClass ___

103
Q

Given the following flow and Transform Flight Type. How do the code in Lookup transform look likes if the LookupTransform output is “AMERICANAIRLINE”? Below is Transform Flight Type code. ___ %dw 2.0 output application/java fun name(FlightType:String) = upper(FlightType) — name(payload.FlightType) ___ lookup [listener] -> [logger] -> [set payload ({“FlightType”:”americanairline”})] -> [transform message (Lookup Transform)] -> [logger] lookupflights [transform message (Transform FlightType)]

A

lookup(“lookupflights”,{FlightType:payload.FlightType})

104
Q

A web service implements an API to handle requests to http://flights.com/flight?airline=“”. A web client makes a request to this API implementation at http://flights.com/flight?airline=“American”. What is the correct DataWeave expression to retrieve the value American?

A

[attributes.queryparams.airline]

105
Q

What is the correct dataweave expression to set on choice so UnitedAirline will be selected? ___ choice [listener] -> [set payload (UnitedAirline)] -> choice -> Expression? -> [Set Payload] -> [Logger] -> Default -> [Set Payload] ___

A

[payload == ‘UnitedAirline’]

106
Q

A developer is tasked to create a function named “doProcess” that accepts a string and a number as its parameters in the same order. How should the developer declare this function in a DWL file?

A

fun doProcess( data:String, num:Number ) = /do Something/

107
Q

Which of the following is the correct way of declaring a local variable?

A

var fullname = payload.firstname ++ “ “ ++ payload.lastname

108
Q

How do you use the capitalize function?

A

import capitalize from dw::core::Strings output application/json — { full_name: capitalize(“Juan Dela Cruz”) }

109
Q

What is the output of Map?

A

Array

110
Q

There’s an existing webservice endpoint that don’t have SLA and Proxy. What should be done if an SLA should be added but not to increase worker size?

A

Deploy the application in Runtime and set an api manager to connect to it

111
Q

Assume that a database table contains accountID column. This data is unique for every record. The MULE application used ‘On Table row’ components to sync data from database table. What process to setup to make sure accountID is always unique?

A

Set the watermark column to AccountID.

112
Q

One IT team developed an API in 2 months. Another IT team developed the same API what could have prevented wasted 2 months’ effort.

A

Center for Enablement

113
Q

A RAML data type fragment named FlightType.raml is placed in the dataTypes folder in an API specification project. What is the correct syntax to reference to the fragments?

A

type : !include dataTypes/FlightType.raml

114
Q

What is the correct way to start a Modern API according to Mulesoft?

A

Gather requirements and involve stake holders for feedback loop

115
Q

What is the first step in designing a Mule application.

A

gather requirements, prototyping, spec driven.

116
Q

How to route to all HTTP Requests?

A

/*

117
Q

Which among the following is the correct way to add a uri parameter in the resource below? ___ Display Name: GET /resource Basic Settings Connector configuration: HTTP_Listener_config General Path: /resource ____

A

/(ID)

118
Q

What is the syntax for input parameters to use URI parameter? ___ Display Name: Copy_of_Select Basic Settings Connector configuration: Database_Connectivity Query SQL Query Text: SELECT * FROM american WHERE ID = :ID Input Parameters: ?

A

[{‘ID’: attributes.uriParams.ID}]

119
Q

After enforcing an SLA policy in API manager, what is the next step to enforce the API to add client ID and client secret?

A

Modify the API spec in Design Center to require client id and client secret headers with requests

120
Q

Implementation (NOT interface) of an API was modified, what needs to be done for changes to take effect

A

restart the application

121
Q

A new SLA policy was created. What needs to be done for the policy to be enforced?

A

redeploy the application

122
Q
A