Mulesoft Question & Answer
Mulesoft Question & Answer
#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
#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: 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.
#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.
#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
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.
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}