100% found this document useful (1 vote)
1K views17 pages

Mulesoft Question & Answer

The document contains questions and answers related to Mulesoft concepts like flow vs subflow, error handling components, API-led architecture, scaling in cloudhub, RAML definitions, and SOAP services. Key points discussed include: - The difference between a flow and subflow in how they handle errors. - Using scatter-gather and parallel processing to make external API calls more efficient from a process API. - Vertical and horizontal scaling approaches in cloudhub. - The definitions of traits, data types and libraries in RAML. - How to create and consume SOAP services in Mule.

Uploaded by

Mukesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
1K views17 pages

Mulesoft Question & Answer

The document contains questions and answers related to Mulesoft concepts like flow vs subflow, error handling components, API-led architecture, scaling in cloudhub, RAML definitions, and SOAP services. Key points discussed include: - The difference between a flow and subflow in how they handle errors. - Using scatter-gather and parallel processing to make external API calls more efficient from a process API. - Vertical and horizontal scaling approaches in cloudhub. - The definitions of traits, data types and libraries in RAML. - How to create and consume SOAP services in Mule.

Uploaded by

Mukesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

#Question : What is difference between flow and Sub_Flow mule component.

#Answer
Flow
1. contains Source, Process and Error Handling
2. Has there on Error Handler
Sub_Flow
1. contains only Process
2. Error will handled by parent Flow

#Question : What is on-error continue and on-error propagate component in


mulesoft?
#Answer : In mulesoft we use on-error continue and on-error propagate to handle
errors. On-error
continue error handler cache error and it return success but on-error propagate
catch
error and return error.
When we use on-error continue in child flow/sub-flow and child flow/sub-flow
raise error,
parent flow-reference will receive success from child flow/sub-flow and it will
continue execution
of next mule component. But when we use on-error propagate in child
flow/Sub_Flow, and
child flow/sub-flow raise error and parent flow-reference will receive error from
child flow/sub-flow.

#Question : What is api led Architecture.


#Answer :API Led connectivity approach is widely successful approach in
building API’s . The concept of System - Process - Experience API’s has
achieved to build reusable assets and highly secured.
Three layer of API led architecture:
• System API’s : Are API’s built to connect through external target system.
• Process API’s: Core business logic we apply in this process api and this api is
intermediate of system and experience api.
• Experience API’s : These are API’s which are a kind of a wrapper either to
Process API’s (if present ) or to System API’s , Which is mainly responsible to
connect with experience system.

#scenario To achieve one business requirement, from Mulesoft process api we


need to call four system api (System API A, B, C, D).
System api A takes 7 sec to complete the processing and no request payload
required to call this API.
System api B takes 6 sec to complete the processing and no request payload
required to call this API.
System api C takes 5 sec to complete the processing and it require system api A
response as a request payload.
System api D takes 4 sec to complete the processing and need source system
request payload to call this API.
What efficient way of external call you will use to make your process api more
efficient. What will be overall processing time of this process API.
#Answer : Use scatter gather to call API system API A, B and D and then call
system API C after scatter Gather. Total process time max of (7, 6 and 4 ) = 7 sec
+ 5 sec = 12 sec

#scenario: To achieve one business requirement, from Mulesoft process api we


need to call four system api (System API A, B, C, D).
System api A takes 3 sec to complete the processing and no request payload
required to call this API.
System api B takes 6 sec to complete the processing and no request payload
required to call this API.
System api C takes 2 sec to complete the processing and it require system api A
response as a request payload.
System api D takes 4 sec to complete the processing and need source system
request payload to call this API.
What efficient way of external call you will use to make your process api more
efficient. What will be overall processing time of this process API.
#Answer : Use scatter gather to call API system API (A then C in one branch), B
and D . Total process time max of (3+2, 6 and 4 ) = 6 sec

#Question: What File, FTP and SFTP connector.


#Answer:
File Connector: File connector is used to connect with local file system.
FTP Connector: FTP connector is used to connect with remote file system.
SFTP Connector: SFTP connector is used to connect with secured remote file
system.

#Question: Difference between put and patch method in rest api.


#Answer:
Put method : Put method is use to complete replace a resource or create a new
resource if resource doesn't exist.
Patch method : Patch method is used to partial update resource.

#scenario: In a process api, we want to call API A, API B and API C one after
another. But API B is not critical part of business, even if API B call will fail we
should not stop our process API execution. How you will handle this scenario.
#Answer: Put API call B inside try-block mule processor and put
on-error-continue in error handling block of try block. As a result even if API B
call will fail it will continue with next mule processor after try block and completed
execution of process api.

#Question : What is traits, dataType and library in RAML.


#Answer :
Trait : traits are reusable component of method of RAML file. example headers,
queryParams.
DataType: DataType define structure of body in RAML. It can be request body or
response 200, 400, 401 body.
Library: Library is collection of traits and Datatype of RAML.

#Question: What is custom policy in mulesoft ?


#Answer: Mulesoft anypoint platform api manager provide Policies enable you to
enforce regulations to help manage security. But there may be scenario you will
not get regulations to help manage security. In this case you need to create your
own policy and need to deploy on anypoint platform, these policy are known as
custom policy.
Custom Policies are policies that anyone can develop and apply to their APIs,
with the intention of extending existing functionality or defining new ones.
The current workflow to get a working policy for Mule 4 that can be applied in
Anypoint Platform consists of:
1. Develop the policy.
2. Package the policy.
3. Upload the resulting policy assets to Exchange.
4. Apply the policy to any API through API Manager.
#Example : your api validate JWT token and instead of applying this validation
logic on api level, you can create custom policy for jwt token validation and you
can apply like other policy in API manager ex rate limiting and other mulesoft
policy.

#Question: How to handle business error in Mulesoft.


#Answer: In mulesoft we have raise-error mule component which we use to raise
business error.
Business error: Error due to business scenario.
For example if customer applying for premium service and usertype is nod gold
user then raise business error.
#Question: In cloud-hub deployment modal what do you mean by vertical scaling
and what is horizontal scaling.
#Answer: in cloud-hub deployment model, worker is basic component of
deployment, where we deploy our mule application. There are 7 type of worker
available in cloud-hub and each worker has some vCores, heap memory and
storage. In one worker we can only deploy one mule application.
Vertical scaling: When we deploy our mule application on any type of mule
worker. Slowly request size of our mule application keep increasing and that
particular worker unable to handle that request payload then we can do vertical
scaling and we can change our worker type and we should go for worker having
more vCores, heap memory and storage. This process is know as vertical
scaling.
horizontal scaling: When we deploy our mule application to one worker and
slowly number of request to mule application keep increasing. There will be one
point where you mule application will not able to handler all request at that time
you can deploy your mule application to one more worker so that it will able to
handle more number of request. This is know as horizontal scaling where you are
increasing number of worker.
#Question: What all error handling component available in mulesoft.
#Answer: In Mulesoft we have two error handling component, on-error-continue
and on-error-propagate.
on-error-continue : on-error-continue error handler handler catch error and send
success response.
on-error-propagate: on-error-propagate error handler handler catch error and
send error response.
If child flow throw error and child flow contains on-error-continue then parent flow
flow-reference will receive success from child flow and will continue execution
after flow-reference mule component.
If child flow throw error and child flow contains on-error-propagate then parent
flow flow-reference will receive error from child flow, which will be catch by error
handler of parent flow. Mule component after parent flow flow-reference will not
be executed.

#Question: If we hit the API, in the flow which component it will trigger first?
whether it is Listener or API Kit router?
#Answer: First request will go to http listener. We use http listener to expose our
api as rest api, so http listener will be our entry point.

#Question: What is difference between for each and parallel for each mule
processor ?
#Answer: For each mule process one or more record at a time in sequential way
but parallel for each mule component process multiple records at a time in
parallel way.
For each mule processor do single threaded processing but parallel for each do
multi threaded processing.

#question : What is implementation URL? How we can remove non-function


requirement from our implementation.
#answer: When we deploy our mule application jar on cloudhub it generate one
url that is our implementation url. We use this url with base path to call api.
To remove non functional requirement ( apply policy , SLA), we can create proxy
url on top of implementation url. We can apply all non function requirement
(policy, SLA) on proxy on proxy url.

#Question: How to create and consume SOAP service in Mule?


#Answer
Creating SOAP Service – We can create a SOAP service the same as we create
Mule Project With RAML, the only change is instead of RAML we need to use
WSDL.
WSDL (Web service description language)
Consuming SOAP Service – We can use Web Service Consumer component in
our mule flow to access/consume SOAP service.

#Question: What is traits, DataType and Library in RAML?


#Answer:
Traits are reusable component of http methods. we can creates traits of headers,
queryParams, body etc. We use is keyword to include traits in main RAML.
Datatype is schema we use to define our request and response for API in RAML.
We use type keyword to use datatype.
Library is collection of traits and dataType. we use uses keyword to use library.

#Question: What is RAML and What is use of RAML?


#Answer: RAML – RESTful API Modeling Language
RAML contains endpoint URL, request/response schema, HTTP methods,
headers, query and URI parameter.
RAML helps the client (a consumer of the service) know, what the service is and
what/how all operations can be invoked.RAML helps the developer in creating
the initial structure of this API. RAML can also be used for documentation
purposes.

#Scenario: In request payload you are receiving huge amount of data. How and
what mule component you will use to make your api efficient to process those
huge amount of data.
#Answer: We will use batch processing to divide that payload in multiple batch
and batch processor will create multiple thread to process each batch in parallel.
Note: Each thread will process records of one batch in sequential way and once
complete it will pick new batch from queue, where batch processor keep all
batches after or before processing.

#Question: What Is Rate Limiting Policy Spike Control Policy?


#Answer: In Rate Limiting Policy, one is allowed to send only a certain number of
requests in a given time interval. The Spike Control Policy is provided for
smoothing API traffic. The policy ensures that within any given period of time, no
more than the maximum configured requests are processed.
When a request is sent and the rate limit is not reached, the request is processed
further. But if the rate limit has been reached, the request is not processed and is
terminated.
In spike control if there is no request quota in the current window, the policy
allows requests to be queued for later reprocessing without closing the
connection to the client.

#Question: What is API Auto Discovery for MuleSoft Application deployed to


CloudHub and On Premise.
#Answer: API Auto Discovery is a mechanism that manages an API from API
Manager by pairing the deployed application to an API created on the platform.
API Management includes tracking, enforcing policies if you apply any, and
reporting API analytics. Critical to the Auto discovery process is identifying the
API by providing the API name and version.
• API must exist in API Manager, configured with either a basic endpoint, or a
proxy endpoint.
• Mule must be configured to use AnyPoint Platform credentials.
• The auto discovery element must be configured in your Mule application. This
XML element must point to the specific API in API manager which you want to
pair to.
• Need environment client_id and client_secret. You can get client_id and
client_secret from AnyPoint Platform.

#Question : What is Anypoint VPC ?


#Answer: VPC stand for virtual private cloud and it allow you to create isolated
and virtual network in cloud.
The base Anypoint VPC subscription includes two Anypoint VPCs and each
Anypoint VPC can be associated with multiple environments. This allows you, for
example, to have one isolated network for your production environment, and
another for your non-productions environments, for example, QA and staging.
Your licensing requirements depend on your specific deployment scenario.
Anypoint VPC supports different Amazon regions. During setup, you need to
specify which Amazon region you want. You can even have multiple Anypoint
VPCs inside a single Amazon region.

#Question: Cloudhub and Customer hosted deployment modal.


#Answer :
MuleSoft-hosted
• Each Mule runtime is automatically installed in a separate CloudHub worker
• Can host one Mule application in a dedicated CloudHub worker
• No contention for host resources
• Automatic upgrades/patches
• Globally available
• Built-in security and SLAs
• Usually managed by MuleSoft's Anypoint
Customer-hosted
• Mule runtimes can be deployed to various types (on-premises or cloud) of
customer-hosted infrastructure
• Some customer-hosted infrastructure can run multiple Mule applications in one
Mule runtime
• Can have contention for host resources
• Customer must schedule and install updates
• Customer must provision across regions and multiple premises
• Customer defines and controls security and SLAs
• Can be managed by MuleSoft's Anypoint Platform

#Question: what is exchange and why we publish RAML in exchange.


#Answer: Exchange is central repository for mulesoft resources. In exchange you
can publish your mulesoft resources like RAML, mule api, connectors etc and
you can share it within or outside your organisation.
We publish RAML on exchange to make it available within organisations, so that
we can give access to BA people and end user to validate and give feedback on
RAML. This process is part of api development lifecycle.

#Question:What is the custom connector and how we will create custom


connector and when we will use custom connector in mule 4?

#Answer:On any point exchange and mulesoft any point platform you can see
many connectors, these connectors are developed by mulesoft and multiple third
party to connect with different external systems and to achieve multiple
functionality. But if your client have some specific requirements or want to
connect with some external system, which you can’t achieve using existing
connector then you can make custom connector. This connector is developed by
developer on organisation level to meet specific requirement . Ex : Generally
many company create connector for logging

What is the structure of Raml?

RAML is rest full api modelling language and it have 4 major component and you
can say structure. 1) Operation (it define the operation performed by api.
Example : student resource and get method : mean we are going to retrieve
student resource detail using this api) 2) Input ( it define the api input payload
structure ) 3) Output ( it define structure of api output payload structure) 4)
Underlying data type( it define data type of input and output payload ex :
application/Jason, text, application/xml)

#Question: What is domian project and can we use domain project in cloudhub
deployment modal ?
#Answer: Domain project is common mule project , where you can keep all
common mule resource which can be used by multiple mule application deployed
in same runtime. It can contains connector configuration , property file etc.
We can't use domian project in cloud-hub deployment modal, since in cloudhub
we can deploy more then one application in same runtime that is worker. It can
be used only in On-premise deployment modal.

#Question : Mention flow processing strategies in MuleSoft.


#Answer :
MuleSoft has six types of strategy for flow processing:
Synchronous flow processing
Asynchronous flow processing
A queued asynchronous flow processing
Custom flow processing
Tread per processing
Queued flow processing
Non-blocking flow processing

#Question : Difference between SOAP and REST is:


#Answer :
SOAP stands for Simple Object Access Protocol
REST stands for Representational State Transfer
SOAP cannot make use of REST since SOAP is a protocol, and REST is an
architectural pattern.
REST can make use of SOAP as the underlying protocol for web services
because, in the end, it is just an architectural pattern.
SOAP can only work with XML format. As seen from SOAP messages, all data
passed is in XML format.
REST offers various data formats such as JSON, plain text, HTML, XML, etc. But
the most preferred format for transferring data is JSON.

#Question What are the MUnit in mulesoft?


#Answer: In MUnit framework, a developer can create a Mule test by using
Java code as well as Mule code.
The programmer can design and test Mule APIs and apps, either in XML or
graphically within Anypoint studio or platform.
MUnit allows integrating the testing into the current CI/CD process.
MUnit offers auto-generated tests and coverage reports to reduce manual
work.
Developers can also use local FTP/DB/mail servers to make the testing
process more portable through the Continous Integration.
It allows enabling/disable tests.
Programmers can extend the MUnit framework using plugins.
Features to verify message processor calls.
It provides error reports with a Mule stack trace.
#Question What is API?
#Answer API is the acronym for Application Programming Interface. It is a
software interface that allows two applications to interact with each other without
any user intervention.
APIs provides product or service to communicate with other products and
services without having to know how they're implemented.

#Question: What is async scope in mulesoft. In which scenario we should use


Async scope.
#Answer The Async scope is a branch processing block that executes
simultaneously with the main flow. The main flow continues to execute while it
initiates and processes the Async processing. The flow does not have to pause
until the last message processor embedded in the asynchronous flow has
completed its task.
Async can be useful for executing time-consuming operations that do not require
you to send a response back to the initiating flow.

#Question: How to skip null value in dataweave expression ?


#Answer: Whenever the output has null values in its elements or attributes, you
can specify whether this generates an outbound message that contains fields
with "null" values, or if these fields are ignored entirely. This can be set through
an attribute in the output directive named skipNullOn, which can be set to three
different values: elements, attributes, or everywhere.
%output application/xml skipNullOn="everywhere"

Give an example of the Resource URI & method, of a Library API, for the
following:
For Example: GET /fruit/{apples}?colour=red
Retrieve all books : GET /books
Retrieve a book based on its internal library Book Id : GET /books/{bookId}
Retrieve a book based on its ISBN number : GET /books/{ISBN}
Retrieve all books by a specific author : GET /books?authorId= A12345
Add a new book to the library : POST /books
Delete a book from the library : DELETE /books/{bookId}
Update a books condition in the library (e.g. only set status=’Damaged’) : PATCH
: /books/{bookId}

#Question : What Is Connector In Mule ?


#Answer : Connector is mulesoft component use to connect with external
system. A connector is in charge of controlling the usage of a particular protocol.
It is configured with parameters that are specific to this protocol and holds any
state that can be shared with the underlying entities in charge of the actual
communications.
For example: a JMS connector , File/FTP/Sftp connector, DB connector

#Question : What Is Transformer In Mule ?


#Answer : Transform mule component transform message from one format to
another format with the help of dataweave expression.A transformer takes care
of translating the content of a message from one form to another. It is possible to
chain transformers to accumulate their effects. Transformers can kick in at
different stages while a message transits through a service.

#Question: What Is Polling Frequency Property In File Connector In Mule ?


#Answer :When we want file inbound endpoints to poll their source directories for
new content. This is accomplished by setting the pollingFrequency to some time
stamp. It can be fixed frequency or cron job expression.

#Question: What is a SOAP Web Service?


#Answer: SOAP simply stands for Simple Object Access Protocol. It is defined as
an XML-based protocol for accessing web services. SOAP is considered as a
W3C recommendation for communication between two applications.
SOAP is XML based protocol. It is platform-independent and language
independent. By making use of the SOAP, you will be capable interact with other
programming language applications.

#Question: Difference between map and mapObject in DataWeave?


#Answer: The map is to go through the elements in the array. It will run for each
element or object of array. The mapObject is to go through the keys and values in
each of the objects of the array.

#Question : What are the features of MUnit?


#Answer: The features of MUnit are as follows:
In the MUnit framework, a developer can create a Mule test by making use of
Java code as well as Mule code.
The programmer can design and test the Mule APIs and apps, either in XML or
graphically within Anypoint studio or the platform.
MUnit allows the integration of the testing into the current CI/CD process.
MUnit offers auto-generated tests and coverage reports for reducing the
manual work.
Developers can also use the local FTP/DB/mail servers for making the testing
process more portable through the Continuous Integration.
It allows enable/disable of tests.
Programmers can extend the MUnit framework by making use of plugins.
It has features for verifying the message processor calls.
It provides the error reports with a Mule stack trace.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy