SlideShare a Scribd company logo
Page 1 of 10
1TechieVarsity - Mule ESB Interview Questions Sample
Objective: Objective of the document is to provide a comprehensive list of Interview
questions or Certification preparation guide of Mule ESB. However, this document is a sample
of questions. We aim to provide a document covering all areas soon.
Please send a Thank you note or any feedback you wish to give to training@techievarsity.org, if
you like this document.
Scenarios
Scenario – Define a flow which receives Http request and sends a response. What are the
building blocks required in the flow?
 Http Request
 Set Payload
Scenario - Define a flow which must print entire Payload message. What are the building
blocks required in the flow?
 Http Request
 Logger – Set logger message to #[message.payload]
Scenario – Define a flow, which uses MEL expression to access an inbound property of the
message: the HTTP request and use that value to create a flow variable on the message. What
are the building blocks required and how is the property accessed?
 Http Request
 Variable
 Logger
What are the steps in connecting to a Twitter or Salesforce API from AnyPoint platform
1. To use the Twitter API, you must first create a Twitter developer account and obtain a
set of credentials in the dev portal of either Salesforce or twitter.
2. Create access token in the application.
3. Create a flow in Anypoint Studio
Page 2 of 10
2TechieVarsity - Mule ESB Interview Questions Sample
4. Search for the below building blocks in the Studio palette and drag each to create this
application:
After you configure the individual elements within it, which is in the next section, this flow
accomplishes the goals that you set out to achieve with this application. Each building block
that you select and place on the canvas performs part of the functionality of your application,
as shown in the image below.
1. Configure Http connector with Host and Port no.
2. In connector configuration, configure Operation and username
3. It retrieves the results in Connector
4. It gives an option to retrieve results of no. of pages and no. of tweets it returns
5. Logger can be configured to print results of tweets returned
Page 3 of 10
3TechieVarsity - Mule ESB Interview Questions Sample
Note: When you are questioned about any Anypoint connector connection configuration, same
can be repeated except the connector configuration.
Scenario - How to convert an xml input into JSON in Mule ESB flow
Use Transform Message:
<dw:transform-message doc:name="Transform Message">
<dw:set-payload><![CDATA[%dw 1.0
%output application/json
---
payload]]></dw:set-payload>
</dw:transform-message>
In the below configuration xml, what activities does the flow contain
 http listener
 set payload
A flow has the following configuration
<flow>
----
<set-property doc:name=”Property” propertyname=”size” value=’small”/>
----
</flow>
Page 4 of 10
4TechieVarsity - Mule ESB Interview Questions Sample
What is the Correct configuration of message processor at Point A to extract 3rd
result’s full
name field from database result before writing payload to a file?
#[message. payload[2].fullname]
Page 5 of 10
5TechieVarsity - Mule ESB Interview Questions Sample
Concepts
What is Mule?
Mule ESB is a lightweight Java-based enterprise service bus (ESB) and integration platform that
allows developers to connect applications quickly and easily, enabling them to exchange data.
Mule ESB enables easy integration of existing systems, regardless of the different technologies
that the applications use, including JMS, Web Services, JDBC, HTTP, and more.
What is RAML?
RAML – Restful API Modeling language.
RAML let the developer know structure of API which can be used for documentation purpose.
RAML contains Endpoint URL’s for API, Request and Response Schemas, Allowed Http methods
(GET, PUT, DELETE), Query and URI parameters. It helps consumer of the API know, structure of
API and which operations can be invoked.
What is a flow
A Mule application begins processing a message it is received by an inbound endpoint in a flow.
This flow can then either implement all processing stages, or route the message to other flows
or sub flows to perform specific tasks.
What are the different types of flow
Subflow – Subflow executes in the same thread of the calling process. Calling process triggers
the sub-flow and waits for it to complete and resumes once the sub-flow has completed.
Synchronous Flow– Same as sub-flow, the only difference is that in synchronous flows exception
strategy is defined separately, does not inherit the exception strategy of its calling flow.
Asynchronous Flow - Calling process triggers the sub-flow and waits for it to complete; for
asynchronous flow the flow, calling process triggers an asynchronous flow and moves ahead to
its next activity. An asynchronous flow executes in parallel to its calling/parent flow in a
different thread.
Private Flow – flow that does not have an inbound connector in the source. Means a private
flow cannot start of its own on receiving the inbound message as it does not have any inbound
connector, A private flow can only be called using flow-ref same as sub-flow.
What are the different types of variables in mule?
Page 6 of 10
6TechieVarsity - Mule ESB Interview Questions Sample
Flow Variable - You can think of a flow variable like a local variable in a function or a method,
once the execution flow is out of the function or method the local variable is no longer
accessible. After setting a flow variable, programmers can access them through the following
"Mule Expression Language" (MEL)
Session Variable - Session variable is variable that would still maintains its value when it crosses
transport, but not all types of session support transport crossing scopes. After setting a session
variable programmer can access them through the following "Mule Expression Language" (MEL)
Record Variable - Record variable is for batch processing flows
What are the different types of Exception Handling?
Default Exception Handling
Global Exception Handling
Catch Exception Handling
Choice Exception Handling
Rollback Exception Handling
What is Global element
A Global Element is a reusable object containing parameters that any number of elements in a
flow can share. You typically reference a global element from Anypoint Connectors in your
Mule app project.
What are Shared Resources in Mule and how are they been used?
We can make connectors as a reusable component by defining them as common resources and
expose them to all applications deployed under a same domain, these resources are known
as shared resources. These shared resource needs to be defined inside Mule Domain
Project and then referred to each of the projects that are meant to use the elements in it.
What is Http Proxy and it’s Usecases?
The HTTP Proxy sits between a caller application and a target web resource, propagating HTTP
requests and responses.
Page 7 of 10
7TechieVarsity - Mule ESB Interview Questions Sample
Use Cases
 Exposing a remote web resource as one being hosted behind a corporate firewall
 Adding or removing HTTP headers
 Dynamically dispatching to different remote resources
 Content caching of regularly accessed resource
What is Router, scope and Filter in Mule
Flows include filters, scopes, and routers.
Filter eg., you use a filter to whitelist IP addresses from which your application accepts
messages;
Scope eg., to "wrap" around several message processors and cache the result of the processing
they perform;
Router eg., To send messages down different paths in your application depending on the
content of the message payload.
How is a message In Mule Is Composed?
The Mule message is the data that passes through an application via one or more flows. It
consists of two main parts:
a. The message header, which contains metadata about the message.
b. The message payload, which contains your business-specific data.
What is VM Transport in Mule
Page 8 of 10
8TechieVarsity - Mule ESB Interview Questions Sample
This can be used as the Java Virtual Machine (VM) transport for intra-JVM communication
between Mule flows. This transport by default uses in-memory queues but can optionally be
configured to use persistent queues.
What is a Message Source?
Mule processes messages initiated by an event such as a consumer request from a mobile device,
or a change to data in a database, or the creation of a new customer ID in a SaaS application.
Message source eg., an inbound HTTP endpoint – receives messages from one or more external
sources, thus triggering the execution of a flow.
Message sources in Mule are usually Anypoint Connectors, either via a standard protocol (such as
HTTP, FTP, SMTP) or a third-party API (such as Salesforce.com, Twitter, or MongoDB.
What is a Message Processor?
In Mule, message processors are grouped together by category.
Mule transformers are the key to exchanging data between nodes, as they allow Mule to convert
message payload data to a format that another application can understand.
Mule uses components to conduct backend processes for specific business logic such as checking
customer and inventory databases.
Page 9 of 10
9TechieVarsity - Mule ESB Interview Questions Sample
MEL (Mule Expression Language)
MEL to access flow variable at runtime
#[flowVars.myVar1] – myVar1 is flow variable
MEL Expression – to get an attribute
eg., #[xpath3('//title/@id').value]
What Is the Mule expression to retrieve the value of size property?
#[message.outboundProperties[‘size’]]
What Error Code is generated when there’s no listener or endpoint for
http://localhost:8081/flights/3
404 will be generated
What expression is used to check whether message is payload Is null or not
#[message.payload == null]
A mule Project named ‘test’ is created. Under src/main/app folder, what files are created?
 Mule-app.properties
 Mule-resource.properties
 Test.xml
Page 10 of 10
10TechieVarsity - Mule ESB Interview Questions Sample
Case Study
A university with over 30,000 active students at any time, and over 4,000 staff members. The
records of these students as well as historical records for alumni are managed by a central
student system operated by the Computer Network Services (CNS) of the university which
develops, supports and maintains custom applications for all departments of the university.
The system maintains all student records including applicant data, offers of admissions,
academic history, financial aid, graduation records, and letters and correspondences with
students. Approximately 500 users directly access the student system.
University wanted to replace existing student system, after an evaluation of alternatives, the
university decided upon Oracle’s PeopleSoft Campus Solutions as their new student system. To
facilitate the move from the old Oracle system to Campus Solutions, CNS needed to split the
Student and HR systems, which ran in one large Oracle instance. This required additional
integration between the two Oracle products, Campus Solutions and other ancillary systems.
The Solution
Mule is used to integrate many systems with the existing Oracle ERP implementation.
For example, it is used for transactional systems such as fees and receipting where it posts
transaction on a queue and asynchronously empties this queue to the Oracle ERP system. It
also manages credit and debit transactions, splitting credits from debits and delivering each to a
different place. Outside of ERP-related use cases, Mule is also used for batch jobs, moving text
files, and other uses within the university.

More Related Content

Top 50 MuleSoft interview questions

  • 1. Page 1 of 10 1TechieVarsity - Mule ESB Interview Questions Sample Objective: Objective of the document is to provide a comprehensive list of Interview questions or Certification preparation guide of Mule ESB. However, this document is a sample of questions. We aim to provide a document covering all areas soon. Please send a Thank you note or any feedback you wish to give to training@techievarsity.org, if you like this document. Scenarios Scenario – Define a flow which receives Http request and sends a response. What are the building blocks required in the flow?  Http Request  Set Payload Scenario - Define a flow which must print entire Payload message. What are the building blocks required in the flow?  Http Request  Logger – Set logger message to #[message.payload] Scenario – Define a flow, which uses MEL expression to access an inbound property of the message: the HTTP request and use that value to create a flow variable on the message. What are the building blocks required and how is the property accessed?  Http Request  Variable  Logger What are the steps in connecting to a Twitter or Salesforce API from AnyPoint platform 1. To use the Twitter API, you must first create a Twitter developer account and obtain a set of credentials in the dev portal of either Salesforce or twitter. 2. Create access token in the application. 3. Create a flow in Anypoint Studio
  • 2. Page 2 of 10 2TechieVarsity - Mule ESB Interview Questions Sample 4. Search for the below building blocks in the Studio palette and drag each to create this application: After you configure the individual elements within it, which is in the next section, this flow accomplishes the goals that you set out to achieve with this application. Each building block that you select and place on the canvas performs part of the functionality of your application, as shown in the image below. 1. Configure Http connector with Host and Port no. 2. In connector configuration, configure Operation and username 3. It retrieves the results in Connector 4. It gives an option to retrieve results of no. of pages and no. of tweets it returns 5. Logger can be configured to print results of tweets returned
  • 3. Page 3 of 10 3TechieVarsity - Mule ESB Interview Questions Sample Note: When you are questioned about any Anypoint connector connection configuration, same can be repeated except the connector configuration. Scenario - How to convert an xml input into JSON in Mule ESB flow Use Transform Message: <dw:transform-message doc:name="Transform Message"> <dw:set-payload><![CDATA[%dw 1.0 %output application/json --- payload]]></dw:set-payload> </dw:transform-message> In the below configuration xml, what activities does the flow contain  http listener  set payload A flow has the following configuration <flow> ---- <set-property doc:name=”Property” propertyname=”size” value=’small”/> ---- </flow>
  • 4. Page 4 of 10 4TechieVarsity - Mule ESB Interview Questions Sample What is the Correct configuration of message processor at Point A to extract 3rd result’s full name field from database result before writing payload to a file? #[message. payload[2].fullname]
  • 5. Page 5 of 10 5TechieVarsity - Mule ESB Interview Questions Sample Concepts What is Mule? Mule ESB is a lightweight Java-based enterprise service bus (ESB) and integration platform that allows developers to connect applications quickly and easily, enabling them to exchange data. Mule ESB enables easy integration of existing systems, regardless of the different technologies that the applications use, including JMS, Web Services, JDBC, HTTP, and more. What is RAML? RAML – Restful API Modeling language. RAML let the developer know structure of API which can be used for documentation purpose. RAML contains Endpoint URL’s for API, Request and Response Schemas, Allowed Http methods (GET, PUT, DELETE), Query and URI parameters. It helps consumer of the API know, structure of API and which operations can be invoked. What is a flow A Mule application begins processing a message it is received by an inbound endpoint in a flow. This flow can then either implement all processing stages, or route the message to other flows or sub flows to perform specific tasks. What are the different types of flow Subflow – Subflow executes in the same thread of the calling process. Calling process triggers the sub-flow and waits for it to complete and resumes once the sub-flow has completed. Synchronous Flow– Same as sub-flow, the only difference is that in synchronous flows exception strategy is defined separately, does not inherit the exception strategy of its calling flow. Asynchronous Flow - Calling process triggers the sub-flow and waits for it to complete; for asynchronous flow the flow, calling process triggers an asynchronous flow and moves ahead to its next activity. An asynchronous flow executes in parallel to its calling/parent flow in a different thread. Private Flow – flow that does not have an inbound connector in the source. Means a private flow cannot start of its own on receiving the inbound message as it does not have any inbound connector, A private flow can only be called using flow-ref same as sub-flow. What are the different types of variables in mule?
  • 6. Page 6 of 10 6TechieVarsity - Mule ESB Interview Questions Sample Flow Variable - You can think of a flow variable like a local variable in a function or a method, once the execution flow is out of the function or method the local variable is no longer accessible. After setting a flow variable, programmers can access them through the following "Mule Expression Language" (MEL) Session Variable - Session variable is variable that would still maintains its value when it crosses transport, but not all types of session support transport crossing scopes. After setting a session variable programmer can access them through the following "Mule Expression Language" (MEL) Record Variable - Record variable is for batch processing flows What are the different types of Exception Handling? Default Exception Handling Global Exception Handling Catch Exception Handling Choice Exception Handling Rollback Exception Handling What is Global element A Global Element is a reusable object containing parameters that any number of elements in a flow can share. You typically reference a global element from Anypoint Connectors in your Mule app project. What are Shared Resources in Mule and how are they been used? We can make connectors as a reusable component by defining them as common resources and expose them to all applications deployed under a same domain, these resources are known as shared resources. These shared resource needs to be defined inside Mule Domain Project and then referred to each of the projects that are meant to use the elements in it. What is Http Proxy and it’s Usecases? The HTTP Proxy sits between a caller application and a target web resource, propagating HTTP requests and responses.
  • 7. Page 7 of 10 7TechieVarsity - Mule ESB Interview Questions Sample Use Cases  Exposing a remote web resource as one being hosted behind a corporate firewall  Adding or removing HTTP headers  Dynamically dispatching to different remote resources  Content caching of regularly accessed resource What is Router, scope and Filter in Mule Flows include filters, scopes, and routers. Filter eg., you use a filter to whitelist IP addresses from which your application accepts messages; Scope eg., to "wrap" around several message processors and cache the result of the processing they perform; Router eg., To send messages down different paths in your application depending on the content of the message payload. How is a message In Mule Is Composed? The Mule message is the data that passes through an application via one or more flows. It consists of two main parts: a. The message header, which contains metadata about the message. b. The message payload, which contains your business-specific data. What is VM Transport in Mule
  • 8. Page 8 of 10 8TechieVarsity - Mule ESB Interview Questions Sample This can be used as the Java Virtual Machine (VM) transport for intra-JVM communication between Mule flows. This transport by default uses in-memory queues but can optionally be configured to use persistent queues. What is a Message Source? Mule processes messages initiated by an event such as a consumer request from a mobile device, or a change to data in a database, or the creation of a new customer ID in a SaaS application. Message source eg., an inbound HTTP endpoint – receives messages from one or more external sources, thus triggering the execution of a flow. Message sources in Mule are usually Anypoint Connectors, either via a standard protocol (such as HTTP, FTP, SMTP) or a third-party API (such as Salesforce.com, Twitter, or MongoDB. What is a Message Processor? In Mule, message processors are grouped together by category. Mule transformers are the key to exchanging data between nodes, as they allow Mule to convert message payload data to a format that another application can understand. Mule uses components to conduct backend processes for specific business logic such as checking customer and inventory databases.
  • 9. Page 9 of 10 9TechieVarsity - Mule ESB Interview Questions Sample MEL (Mule Expression Language) MEL to access flow variable at runtime #[flowVars.myVar1] – myVar1 is flow variable MEL Expression – to get an attribute eg., #[xpath3('//title/@id').value] What Is the Mule expression to retrieve the value of size property? #[message.outboundProperties[‘size’]] What Error Code is generated when there’s no listener or endpoint for http://localhost:8081/flights/3 404 will be generated What expression is used to check whether message is payload Is null or not #[message.payload == null] A mule Project named ‘test’ is created. Under src/main/app folder, what files are created?  Mule-app.properties  Mule-resource.properties  Test.xml
  • 10. Page 10 of 10 10TechieVarsity - Mule ESB Interview Questions Sample Case Study A university with over 30,000 active students at any time, and over 4,000 staff members. The records of these students as well as historical records for alumni are managed by a central student system operated by the Computer Network Services (CNS) of the university which develops, supports and maintains custom applications for all departments of the university. The system maintains all student records including applicant data, offers of admissions, academic history, financial aid, graduation records, and letters and correspondences with students. Approximately 500 users directly access the student system. University wanted to replace existing student system, after an evaluation of alternatives, the university decided upon Oracle’s PeopleSoft Campus Solutions as their new student system. To facilitate the move from the old Oracle system to Campus Solutions, CNS needed to split the Student and HR systems, which ran in one large Oracle instance. This required additional integration between the two Oracle products, Campus Solutions and other ancillary systems. The Solution Mule is used to integrate many systems with the existing Oracle ERP implementation. For example, it is used for transactional systems such as fees and receipting where it posts transaction on a queue and asynchronously empties this queue to the Oracle ERP system. It also manages credit and debit transactions, splitting credits from debits and delivering each to a different place. Outside of ERP-related use cases, Mule is also used for batch jobs, moving text files, and other uses within the university.