ExamGecko
Home Home / MuleSoft / MCD - Level 1

MuleSoft MCD - Level 1 Practice Test - Questions Answers, Page 8

Question list
Search
Search

List of questions

Search

Related questions











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.
Edit the dependency in the Mule project's pom.xml file
A.
Edit the dependency in the Mule project's pom.xml file
Answers
B.
Install the dependency to the computer's local Maven repository
B.
Install the dependency to the computer's local Maven repository
Answers
C.
Deploy the dependency to MuleSoft's Maven repository
C.
Deploy the dependency to MuleSoft's Maven repository
Answers
D.
Add the dependency to the MULE_HOME/bin folder
D.
Add the dependency to the MULE_HOME/bin folder
Answers
Suggested answer: B

Explanation:

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

https://docs.mulesoft.com/mule-runtime/4.3/maven-reference

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

A.
#[attributes.queryParams.firstName]
A.
#[attributes.queryParams.firstName]
Answers
B.
#[message.queryParams.hrstName]
B.
#[message.queryParams.hrstName]
Answers
C.
#[message.inboundProperties.'http.query.params'.firstName]
C.
#[message.inboundProperties.'http.query.params'.firstName]
Answers
D.
#[attributes.'http.query.params'.firstName]
D.
#[attributes.'http.query.params'.firstName]
Answers
Suggested answer: A

By default, what happens to a file after it is read using an FTP connector Read operation?

A.
The file is deleted from the folder
A.
The file is deleted from the folder
Answers
B.
The file is moved to a different folder
B.
The file is moved to a different folder
Answers
C.
The file stays in the same folder unchanged
C.
The file stays in the same folder unchanged
Answers
D.
The file is renamed in the same folder
D.
The file is renamed in the same folder
Answers
Suggested answer: C

Explanation:

File is not updated when FTP read operations is performed.

MuleSoft Doc Ref : https://docs.mulesoft.com/file-connector/1.3/file-read

Refer to the exhibits.

The Validation component in the Try scope throws an error.

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

The Validation component in the Try scope throws an error. What response message is returned to a client request to the main flow's HTTP Listener?

A.
Success - main flow
A.
Success - main flow
Answers
B.
Error - main flow
B.
Error - main flow
Answers
C.
Error - Try scope
C.
Error - Try scope
Answers
D.
Validation Error
D.
Validation Error
Answers
Suggested answer: A

Explanation:

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 isSuccess - main flow

1) HTTP listener received request

2) The Flow Reference calls the child flow

3) The Is Number validator creates an Error Object because the payload isn't an integer. Child Flow execution stops

#[error.description] = ''payload is not a valid INTEGER value''

#[error.errorType] = VALIDATION:INVALID_NUMBER

4) The On Error Continue handles the errorThe payload is set to ''Error -- Sub Flow''

5) ''Error -- Sub Flow'' is returned to the main flow as if the child flow was a success. The Set Payload is executed. The payload is reset to ''Success -- Finished Main Flow''

6) ''Success -- Main Flow'' is returned to the requestor in the body of the HTTP request. HTTP Status Code: 200

As you can see, in the above example, because the error was caught by an On Error Continue scope in the child flow (RED in, GREEN out) when the Mule Message returns to the parent flow, the parent flow knows none-the-different that there was a failure because the on error continue returns a 200 success message. Note that because, to the mainFlow, the childFlow appeared to succeed, the processing of mainFlow resumed after the flow reference.

Refer to the exhibit.

What is a valid expression for the Choice router's when expression to route events to the documenticShipping flow?

A.
0#[ payload = 'US' ]
A.
0#[ payload = 'US' ]
Answers
B.
#[ payload == 'US' J
B.
#[ payload == 'US' J
Answers
C.
#[ if(payload = 'US') J
C.
#[ if(payload = 'US') J
Answers
D.
#[ if(payload == 'US') ]
D.
#[ if(payload == 'US') ]
Answers
Suggested answer: B

Explanation:

Choice Router

The Choice router dynamically routes messages through a flow according to a set of DataWeave expressions that evaluate message content. Each expression is associated with a different routing option. The effect is to add conditional processing to a flow, similar to anif/then/elsecode block in most programming languages.

Only one of the routes in the Choice router executes, meaning that the first expression that evaluates totruetriggers that route's execution and the others are not checked. If none of the expressions aretrue, then the default route executes.

Properties of <when>

PropertyDescription

Expression (expression)

Expression in DataWeave language to evaluate input. If the expression evaluates totrue, this routing option is used:

<when expression='#[vars.language == 'Spanish']' >

Mulesoft Doc Ref :https://docs.mulesoft.com/mule-runtime/4.3/choice-router-concept

With respect to above information ,

Option 1 is the correct syntax as others are incorrect because of below reasons

* Single = is not the correct syntax to validate the condition. It should be ==

* If keyword is not required in when condition.

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.
Account Type: #[flowVars.accountType]
A.
Account Type: #[flowVars.accountType]
Answers
B.
Account Type: #[message.inboundProperties.accountType]
B.
Account Type: #[message.inboundProperties.accountType]
Answers
C.
Account Type: # [attributes.accountType]
C.
Account Type: # [attributes.accountType]
Answers
D.
Account Type: #[vars.accountType]
D.
Account Type: #[vars.accountType]
Answers
Suggested answer: D

Explanation:

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]

Refer to the exhibit. The Batch Job processes, filters and aggregates records, What is the expected output from the Logger component?

A.
[10. 20, 30. 40, 50, 60]
A.
[10. 20, 30. 40, 50, 60]
Answers
B.
[10. 20] [30, 40] [50, 60]
B.
[10. 20] [30, 40] [50, 60]
Answers
C.
[20, 40, 60]
C.
[20, 40, 60]
Answers
D.
[20. 40] [60]
D.
[20. 40] [60]
Answers
Suggested answer: D

Explanation:

* Batch scope has filter criteria which says paylod mod 2 = 0 whch 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 option 3 is correct answer.

[20,40]

[60]

Behavior with aggregator configured with fixed size

In this scenario, the batch step sends the processed records to an aggregator, which starts processing the records and buffering them until the configured aggregator's size is reached. After that, the aggregator sends the aggregated records to the stepping queue.

The batch job builds record blocks of the configured block size and sends them to their corresponding batch step for processing. Each batch step receives one or more record blocks and starts processing them in parallel. After the batch step processes a record, the batch step sends the record to the aggregator for further processing. The aggregator continues processing records until the number of aggregated records reaches the configured aggregator's size.

https://docs.mulesoft.com/mule-runtime/4.3/batch-processing-concept

Refer to the exhibits.

The input array of strings is processed by the batch job that processes, filters, and aggregates the values. What is the last message logged by the Logger component after the batch job completes processing?

A.
[ ['A', 'C', 'D' ], ['E'] ]
A.
[ ['A', 'C', 'D' ], ['E'] ]
Answers
B.
[''E'']
B.
[''E'']
Answers
C.
[''D', 'E']
C.
[''D', 'E']
Answers
D.
[ 'A', 'C, 'D', 'E' ]
D.
[ 'A', 'C, 'D', 'E' ]
Answers
Suggested answer: B

Explanation:

Logs would look like:

INFO 2021-06-09 19:14:56,039 [[MuleRuntime].uber.06: [validationtest].batch-job-validationtestBatch_Job-work-manager @6de10f3e] [processor: validationtestFlow/processors/1/route/0/route/0/aggregator/processors/0; event: bfb751e1-9939-11eb-9f69-02053763653a] org.mule.runtime.core.internal.processor.LoggerMessageProcessor:

[

''\''A\'''',

''\''C\'''',

''\''D\''''

]

----

INFO 2021-06-09 19:15:02,486 [[MuleRuntime].uber.06: [validationtest].batch-job-validationtestBatch_Job-work-manager @6de10f3e] [processor: validationtestFlow/processors/1/route/0/route/0/aggregator/processors/0; event: bfb751e1-9939-11eb-9f69-02053763653a] org.mule.runtime.core.internal.processor.LoggerMessageProcessor: [

''\''E\''''

]

Batch aggregator value is 3. Hence in first time it will print[''A'', ''C'', ''D'']and in next iteration it will print[ ''E'' ]

--------------------------------------------------------------------------------------------------------------------------------------------------

Correct answer is[ ''E'' ]

Refer to the exhibit. 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.
Summary report of processed records
A.
Summary report of processed records
Answers
B.
[ 'Apple', 'Banana' ]
B.
[ 'Apple', 'Banana' ]
Answers
C.
[ 'Apptel2', 'Bananal2' ]
C.
[ 'Apptel2', 'Bananal2' ]
Answers
D.
[ 'Apptel', 'Bananal', 2 ]
D.
[ 'Apptel', 'Bananal', 2 ]
Answers
Suggested answer: A

Refer to the exhibits. A company has defined this Book data type and Book example to be used in APIs. What is valid RAML for an API that uses this Book data type and Book example?

A)

B)

C)

D)

A.
Option A
A.
Option A
Answers
B.
Option B
B.
Option B
Answers
C.
Option C
C.
Option C
Answers
D.
Option D
D.
Option D
Answers
Suggested answer: D
Total 235 questions
Go to page: of 24