0% found this document useful (0 votes)
337 views21 pages

MULESOFT DEVELOPMENT - Interview

This document provides summaries of common questions and their answers related to MuleSoft development: 1. It describes various ways to achieve parallel processing in MuleSoft such as using scatter gather, batch jobs, and parallel for each. 2. It explains how to invoke custom Java classes from DataWeave, access secure properties, explicitly raise errors, and handle errors in the middle of processing in Mule flows. 3. It discusses batch jobs phases, when to use batch processing, and why to use a batch aggregator scope. It also compares for each and batch processing. 4. The document covers transaction management in MuleSoft, asynchronous processing, reliability, performance improvement techniques, optimized memory usage

Uploaded by

Anitha Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
337 views21 pages

MULESOFT DEVELOPMENT - Interview

This document provides summaries of common questions and their answers related to MuleSoft development: 1. It describes various ways to achieve parallel processing in MuleSoft such as using scatter gather, batch jobs, and parallel for each. 2. It explains how to invoke custom Java classes from DataWeave, access secure properties, explicitly raise errors, and handle errors in the middle of processing in Mule flows. 3. It discusses batch jobs phases, when to use batch processing, and why to use a batch aggregator scope. It also compares for each and batch processing. 4. The document covers transaction management in MuleSoft, asynchronous processing, reliability, performance improvement techniques, optimized memory usage

Uploaded by

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

MULESOFT DEVELOPMENT

How to achieve the parallel processing in MuleSoft?


To achieve the parallel processing you can use scatter gather or batch job and with mule 42 on wards there is
also parallel for each has been added to process the message simultaneously, Please visit scatter
gather and parallel for each urls for more information
How to invoke the Custom Java Class from inside a dataweave
%dw
2.0
Import java!
com.mycompany::classname
output
application/json
-
-
-
{
a:
classname::methodName("myString"
)
}

more information
How to access secure property inside dataweave?
By using p(‘secure::<property name>’) you can access the secure property defined as part of secure property
file in mule application – more information
How can you raise error explicitly in Mule flow/subflow?
By using the Raise Error component you can explicitly raise the error in between the flow more information
How can you handle errors in middle of the processing in MuleSoft?
You can use the Try block to handle the errors in between the flows, try block also support the transaction. By
using try block you can use the on-error continue or on-error propagate to handle the error more information
How to call Flow from inside a dataweave?
You can use dataweave lookup function to call flow from inside a dataweave It works in Mule apps that are
running on Mule Runtime version 4.1.4 and later It takes the flow’s name and an input payload as parameters.
For example, lookup(“flowname”, payload)
What is the difference between map, mapObject and pluck?

 map is used to iterate over array


 mapObject is used to iterate over object and return object
 pluck iterates over an object and returns an array of keys, values, or indices in that object.

How will you combine 2 arrays into single array in MuleSoft?


You can use flatten dataweave function to combine two arrays in to single array
What are target variable in MuleSoft
When creating a flow in mule app, you can store data in variable so that any component in a flow can use it. In
Mule 4 Target Variable replaces the Message Enricher of Mule 3, target variable is available with most of the
connectors
How many phases are there for batch job in Mule 4
Each batch job contains 3 different Phase

 Load and Dispatch.
 Process
 On Complete.

When we should use batch processing


You can use batch processing when:

 Synchronizing data sets between business applications, such as syncing
contacts between two different ERPs
 Extracting, transforming and loading (ETL) information into a target system,
such as uploading data from a flat file (CSV) to Hadoop.
 Handling large quantities of incoming data from an API into a different
systems

Why we use Batch Aggregator scope


Batch Aggregator scope is used to accumulate a subset of records from a batch step and process them to
external source or service for example rather than processing single record to target system you can use batch
aggregate to process all the records at once. You can also configure batch aggregator scope to process fixed
size groups of records inside a batch aggregator scope
What is the difference between For each and Batch Process
For each do the processing in single thread while Batch Process performs multi-threaded
processing moreinformation
How to manage the Transaction in MuleSoft
MuleSoft supports two types of transactions

 Single resource( Local)
 XA transactions (extended architecture)
You can configure the transaction depends on the requirement
You can start a transaction from a message source. In this case, the entire flow takes part in transaction This is
useful when working with messaging connectors to prevent the consumption of the message if a problem
occurs when processing it, allowing you to retry later (because of the rollback).
You can also use the Try block which support the transaction when you want to handle the transaction in
middle of the flow
There are below transaction Action define the type of action that operations take regarding transactions

 Always_Begin
 Always_Join
 Begin-or-join
 Join-if-possible
 Indifferent
 None
 Not Supported

Please visit this url for more information


What are various types of error handling in Mule 4?
Mule 4 has redesigned error handling by introducing the error-handler component, which can contain any
number of internal handlers and can route an error to the first one matching it. Such handlers are on-error-
continue and on-error-propagate.
How can you process message asynchronously in MuleSoft?
You can use the Async Scope to process the message asynchronously. – more information
Async can be used to do the processing in parallel with the main flow, it can be used to process the time
consuming operations that does not expect a response back
How can you achieve the Reliability in MuleSoft?
If your application uses a transactional transport such as JMS, VM, DB etc. Reliable messaging is ensured by
the built in support of transactions in the transport. Reliable messaging pattern is important when dealing with
non-transactional endpoints
How can you improve performance of Mule Application in MuleSoft?
There are multiple ways to improve the performance

 Try to save the result and reuse them later
 If processing is expansive do it only once and save result and use them later
 Try to put the validation at start of the flow
 Use Streaming to process data
 Try to process the data asynchronously wherever is possible

How can you optimize memory efficiency of the Code in MuleSoft?



 Do not save the Payload in to the flow Variable as it is more memory
consuming element
 Do not load unnecessary part of the document
 Use better Database polling for highly concurrent scenarios

What is distributed file polling?


In mule 4 distributed file polling is used to poll files in cluster nodes
There are few connectors where this feature is enabled by default

 File Connector
 FTP Connector
 SFTP Connector

You can configure connectors to poll only from primary node @primaryNode Only which ignores the default
setting set by mule runtime engine
How will you implement caching in MuleSoft?
There are 2 ways to implement the caching in MuleSoft
1.
 Use Object Store – more information
 Use Cache scope to cache the Response – more information

If we wanted to process only one message at a time in mule flow how can we achieve that?
we can make a flow to process in single thread, there is an option to define the Max Concurrency you can
configure the same as 1 to process only one message at a time

DATAWEAVE

How to invoke the Custom Java Class from inside a Dataweave?


Below is the example
%dw
2.0
Import java!
com.mycompany::classname
output
application/json
-
-
-
{
a:
classname::methodName("myString"
)
}
More info – https://mulesy.com/invoke-custom-java-class-using-dataweave

How to access secure property inside Dataweave?


By using p(‘secure::<property name>’) you can access the secure property defined as part of secure property
file in mule application
More info – https://mulesy.com/read-properties-in-mule-4

How to call Flow from inside a Dataweave?


You can use Dataweave lookup function to call flow from inside a Dataweave It works in Mule apps that are
running on Mule Runtime version 4.1.4 and later. It takes the flow’s name and an input payload as parameters.
For example, lookup(“flowname”, payload)

How to Log message in Dataweave?


Use log(” Current Time Stamp “,now()) function in Dataweave
More info – https://mulesy.com/logging-inside-dataweave-transformation

How to use comment line in Dataweave?


//
single
line
comment.

/*
*
This
is.
*
multi-
line.
*
comments
in.
*
DataWeave.
*/

What is the latest version available for Dataweave?


Dataweave latest version is 2.3, please see the new features in latest Dataweave
version https://mulesy.com/latest-features-dataweave-2-3-0

How to use map operator in Dataweave?


Please see – https://mulesy.com/map

How to use filters in Dataweave?


Please see – https://mulesy.com/filter-in-dataweave-mule-4

How to use the Custom Dataweave functions in Mule?


Please see – https://mulesy.com/custom-dwl-function-using-custom-module

How you can define a variable in Dataweave?


Please see – https://mulesy.com/variables-in-dataweave

How to convert an Object into Array using Data weave?


Use Pluck operator which iterate over an Object and return an array of keys, values, or indices from the object.
More info – https://docs.mulesoft.com/mule-runtime/4.3/dw-core-functions-pluck

How you will parse an XML with or without namespace in Dataweave? How you will retrieve the
attribute value
Please see – https://mulesy.com/xml-processing-in-dataweave

Difference between map and mapObject?


map – Iterates over items in an array and outputs the results into a new array.
mapObject – Iterates over an object using a mapper that acts on keys, values, or indices of that object.
From the functionality wise both are same but both work on different input and return different output, where
array and object are Java array and Java object.

How you can merge two Arrays in Dataweave?


Use flatten operator to merge two array into one – more info
– https://docs.mulesoft.com/mule-runtime/4.3/dw-core-functions-flatten

How you will convert string into Array and vice versa?
String to Array – https://mulesy.com/convert-string-to-array-in-dataweave-2-0
Array to String – https://mulesy.com/convert-array-to-string

What is filter and how we will use it in Dataweave?


Please see – https://mulesy.com/filter-in-dataweave-mule-4

How you will do null check in Dataweave?


Please see – https://mulesy.com/perform-null-check-in-mule-4

Mulesoft Developer Interview Questions for


Freshers
1) What is MuleSoft?
MuleSoft is an integration platform for connecting enterprise and SaaS
applications in the cloud and on-premise.

2) List types of variables in MuleSoft


Types of variables in MuleSoft are:
 Flow Variable: It is used to either set or removes variables tied to a
particular message in the current flow.
 Record Variable: It is used for batch processing flows.
 Session Variable: This variable is used to either set or remove
variables tied to a particular message for the complete lifecycle.

3) What are the various types of messages in MuleSoft?


Various types of messages in MuleSoft are: 1) echo and log message, 2)
bridge message, and 3) build message.

4) Explain Mule ESB


Mule ESB is an architecture developed for programmers. They can
integrate a range of applications together using the bus-like infrastructure.
Mule ESB can be integrated with HTTP, web service, JMS, etc.

5) What is fan-in?
Fan-in helps in taking a decision to continue flow execution. It be used in
combination with fan out.

6) What is a fan-out?
Fan out is primitive that can be used to input messages through the output
terminal once or more than one time. It can also be used as a combination
of both fan-out and fan-in.
7) Mention the features of Mule ESB
The features of Mule ESB are:

 Offer SLA (Service Level Agreement) monitoring and API


management facility.
 It has easy to use and drag and drop graphical design.
 Mule ESB provides high scalability.
 It enables developers to deploy in one click cloud or on-premise
deployments.

8) Mention the basic principles of ESB Integration


The basic principles of ESB integration are:

 Transportation: It negotiates between different formats like JDBC,


HTTP, JMS, etc.
 Transformation: It deals with the transportation of data between
data formats needed by the ESP connector.
 Non-functional consistency: It is the way of how monitoring and
security policies are applied and should be consistent.
 Mediation: It involves offering different interfaces to:
1. Enables different channels to the same component
implementation.
2. Support various service versions for backward compatibility.

9) What is Mule Expression Language?


MEL or Mule Expression Language is a light-weight mule specific language
that can be used to access and evaluate data in the payload.

10) List various types of endpoints in Mule ESB


Various types of Endpoints in Mule are 1) JMS, 2) HTTP, 3) SMTP, 4) IMAP,
and 5) AJAX.

11) What is the full form of SDO?


The full form of SDO is a Service Data Object.

12) Mention different types of Exception Handling


Different types of exception handlings are:

 Rollback exception handling.


 Default exception handling.
 Catch exception handling.
 Global exception handling.
 Choice exception handling.

13) What are the advantages of using ESB?


The advantages of using ESB are:

 It offers a high level of the operational controlling facility from the


portal that is based on the web.
 ESB provides numerous connectivity options using SaaS-based
applications.
 It provides API and analytics management.
 ESB is equipped with numerous bug fixing and automated testing
facilities.
 EDI (Electronic Data Interchange)/B2B (business to business)
integration.
 Batch integration feature using real-time integration methods.

14) What is a transient context?


Transient context is used to pass the values within the existing flow, either
requesting flow or the responding flow.

15) What is Mule Transformer?


Mule transformer is an event instance that refers to a library,
org.mule.api.MuleEvent. This object carries the message with the event.
The main aim of the Mule transformer is to create a chain of transformers.

16) What is API?


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.

17) What are the features of API?


Here are some essential features of API:
 Efficiency
 Wider reach
 Customizable
 Personalization
 Data ownership
 Easy integration with GUI
 Time effective
 Language-independent

18) What is the payload in MuleSoft?


The payload is a mule runtime variable that stores objects or arrays. It
helps developers to access payload under different forms.

19) What are the various parts of composing a message in


Mule?
Different parts of composing a message in Mule are:

 Properties: it contains the header or meta-information or header


similar to the SOAP (Simple Object Access Protocol) message.
 Payload: It is the main data context carried by a particular message.
 Multiple name attachments: It provides support for multiple
messages or payload that occurs during event processing.

20) Mention flow processing strategies in MuleSoft.


MuleSoft has six types of strategy for flow processing:

 A queued asynchronous flow processing


 Custom flow processing
 Tread per processing
 Queued flow processing
 Non-blocking flow processing
 Synchronous flow processing
 Asynchronous flow processing

21) Explain the concept of Correlation Context.


It is a primitive that is used to pass values from request flow to response
flow.

22) Mention different types of primitives used in Mediation


Different types of primitives used in Mediation are:

 Endpoint lookup
 Data handler
 Message element setter
 DB lookup
 Service Invoke
 Type filter
 Stop
 Sub Flow
 Custom mediation fan-out
 Fan-in
 Even emitter
 Header setters
 Message logger
 XSLT
 BO MapMessage filter
 Fail

23) Name different types of ESPs used in the market


Different types of ESPs used in the market are:

 Mule ESB
 JBoss fuse ESB
 Talend

24) Define the model layer in mule


The model layer is the first logical layer. It represents the runtime
environment that hosts services. This layer describes the behaviour of
Mule when processing requests that are handled by services. It offers
services with default values to simplify configuration.

25) Explain connector in MuleSoft


A connector in Mule controls how a particular protocol used. It can be
configured with parameters which are specific to that protocol. The
connector holds any state context which can be shared with any entity in
charge of actual communications.

Mulesoft Interview Questions for Experienced


26) What is Endpoint in Mule?
An endpoint in MuleSoft indicates a particular usage of a protocol. It is for
polling, reading from, or writing to a destination.

Therefore, it controls what underlying entities would be used with a


dependent connector.

27) Define component in Mule


Components perform an important role in MuleSoft services. Every service
is organized with core components and core and inbound and outbound
routers.

They are used to implement behavior in service. It can be very simple, like
logging messages or invoking other services.
28) What is the use of Outbound Endpoint in MuleSoft?
Outbound Endpoint in MuleSoft is used to perform the following things:

 Send SOAP messages


 Write to file streams
 Send email messages

29) Define configuration builders In MuleSoft


MuleSoft is a configuration builder to translate a configuration file into the
graph of the object that makes the running node of ESB.

30) List the types of configuration builders in MuleSoft


Types of configuration builders In MuleSoft are 1) Spring-driven builder
and 2) script builder.

31) What Is TSD in Mule?


TSD or transport service descriptor is a connector used for technical
configuration. It defines classes name used for message receivers,
dispatchers, and requesters. This default value can vary to grasp the
behaviour of transport.

32) Define multicasting router in MuleSoft


Multicasting router in MuleSoft sends messages to more than one
endpoints over different transports. It allows the user to move the same
messages across different endpoints.

33) What are the characteristics of Global Endpoint?


Characteristics of global endpoint are:
 The global endpoint is not typified or outbound routing.
 It can be usable in different places of configuration files.
 The global service name must be applied so that it can reference the
endpoint.
 It helps to clarify the usage of a particular destination.

34) Explain VM transport in MuleSoft


The VM (Virtual Machine) transport is a special type of transport that can
be used to send a message via memory. These messages never leave the
Java Virtual Machine, and the Mule instance is running in.

35) Name different types of web services


Different types of web services: 1) RESTful web services and 2) SOAP web
services.

36) What are Web Services?


Web services are a standardized way or medium to propagate
communication between the client and server applications on the World
Wide Web.

37) What is Restful Web Service?


Restful Web Service is a light-weight, maintainable, and scalable service
that is built on the REST architecture. Restful Web Service, expose API from
your application in a secure, uniform, stateless manner to the calling
client. The calling client can perform predefined operations using the
Restful service.

38) Mention the difference between SOAP and REST


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

39) What is RAML?


The full form of RAML is the RESTful API Modeling Language. It is a YAML-
based language that describes RESTful APIs.

RAML is best for the information needed to describe RESTful APIs. It is


similar to WSDL (Web Services Description Language).

RAML contains request/response schema, URI parameter, endpoint URL,


HTTP methods, and query.

40) What is caching?


The cache concept is a way of storing the copy of the file in the cache, or
any temporary storage location to access it quickly.

41) What are the Models?


Model is a grouping of services that are created in MuleSoft studio. User
has the liberty to start and stop all the services inside a particular model.

42) Name supported languages by MuleSoft


Supported languages of MuleSoft are 1) Ruby, 2) Python, 3) Groovy, and 4)
JavaScript.
43) List various the categories of Mule Processors
Categories of Mule Processors are: 1) Components, 2) Exception strategies,
3) Business events, 4) Routers, 5) Connectors, and 6) Transformers.

44) What are the configuration patterns provided by


MuleSoft?
Configuration patterns provided by of MuleSoft are:

 Bridge
 Validator
 WS proxy
 Simple service pattern
 HTTP proxy

45) What are the advantages of the logger component?


The advantages of the logger component are:

 Users can add this core component anywhere in the workflow.


 It can be configured to any combination of strings and expressions.

Mulesoft Interview Questions for 5 Years


Experience
46) What is scheduler Endpoint?
Scheduler Endpoint is a MuleSoft component or middleware are working
on time-based conditions. It allows the user to trigger whenever this
condition is met.

47) Explain the parameters to configure a scheduler


Parameters related to configuring a scheduler are:

 Frequency: It is a frequency used by Scheduler to triggers flows.


 Start Delay: It is the time to wait before triggering any flow.
 Time Unit: The time unit for frequency and Start Delay.

48) What is Choice Router?


Choice Router dynamically routes messages using a flow. It is based on a
set of DataWeave expressions to evaluate the message content.

49) What is a Scatter-Gather Router?


Scatter-Gather Router is the most used routing event processor. It can
send a request message to more than one target concurrently. This router
then collects responses from all routes and aggregate back into one
response.

50) What are error types in MuleSoft?


Following are the effort types:

 Transformation
 Expression
 Routing
 Duplicate_Message
 Source_Response
 Timeout
 Security
 Connectivity
 Validation

51) What are the features of MUnit?


The features of MUnit are:

 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.

52) What is Exchange?


Exchange is a hub for the development team. It is used to store and access
API, connectors, templates, documentation, and more.

53) What are the advantages of SOAP?


The advantages of SOAP are:

 SOAP is the perfect medium that is developed for web service to talk
with client applications.
 SOAP is a light-weight protocol which can be used for data
interchange between applications.
 SOAP protocol can work any programming language based
applications on Windows and Linux platforms.
 It does not require customization to run the web services built on the
SOAP protocol to work on the WWW.
54) Define Batch Jobs in Mule ESB
A batch job is an element in Mule that split large size messages into
records that process asynchronously in a batch job.

55) Explain the Mule data integrator.


A mule data integrator is a tool that is used for mapping data by visualizing
it. It offers drag and drop feature to make a developer’s coding process
easier.

These interview questions will also help in your viva(orals

You might also like