Best Mulesoft Anypoint Studio interview questions in 2021
What connectors have you used?
A. Salesforce, Sharepoint, JMS, HTTP, HTTPS, FTP, SFTP, Database, File…etc.
What are the key differences between Mule 3 & Mule 4?
Difference between VM queue & JMS
A. VM Transport is for intra JVM communication between Mule flows. We can use VM transport to communicate with different flows of the same application whereas JMS is used for communicating with the external applications also.
How to filter duplicate records?
A. Using Idempotent filter to discard duplicate records
What are the core components of Mule ESB?
A. Scheduler, For Each, Logger, Batch (Batch Aggregator, Batch Job, Batch Step), Flow reference, Transform message, Error handling Routers, Scopes and Transformers. Refer Core components of Mule
How to read a file as input other than FTP connector
Scenario: How to fetch and process 5M records(few duplicates) into DB
Different types of flows, flow processing strategies
Difference between sub-flow, private flow?
A. Subflow processes messages synchronously but inherits processing strategy and exception handling strategy from the calling flow (parent flow). It can be used to split common logic and be reused by other flows.
Private flow does not use a source. It can be synchronous or asynchronous based on the processing strategy selected. Also, has its own exception handling strategy. Allows you to define different threading profile.
How can we create a custom policy in Anypoint Studio?
A. Navigate to File > New > API custom policy Project(Beta) in Anypoint Studio
Difference between async flow & async scope
Async Flow: Async Flow is a transactional flow in which the requestor does not wait for the response from the target service and processes the flow
Async scope: 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 scope
Error handling in Mule 3.9
Refer here for the Error handling mechanism in Mule 3.9
What are the changes to Error handling in Mule 4.3
Refer here for more inputs on Mule 4 error handling
How to fetch URI & Query parameters in Mule 4?
A. Attributes in Mule 4 replace inbound properties
How do you consume a SOAP-based web service in Studio
A. Using the Web Service Consumer component. Configure the connector with WSDL or SOAP web service configuration details like Service name, URL, Binding port, etc.
What are the steps involved in MUnit creation?
How do you set environment-specific values in Mule application?
At first, Create a properties file for each development environment in your application. Configure a properties placeholder in your app to look for the environment upon launch. Set an environment variable to point to a specific development environment during application deployment.
Explain Collection aggregator, splitter, object store, cache
What are the variables available in Mule 3?
A. Flow variables, Record variables, Session variables
What are the variables available in Mule 4?
A. Flow variables
How do you import a RAML and use it in Anypoint Studio?
What are various types of Exception Handling?
- Choice Exception Handling.
- Catch Exception Handling.
- Rollback Exception Handling.
- Global Exception Handling.
- Default Exception Handling.
What is Shared Resource in Mule and how they have been used?
We can make connectors a reusable component by defining them as common resources and expose them to all applications deployed under the 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 the definition of Web Services?
Web service is a function or program in any language that can be accessed over HTTP. Message format can be XML or JSON or any other program as long as the other programs can understand and communicate. Any web service has a server-client relationship. Web services can be synchronous or asynchronous. Any web service can have multiple clients.
What are the different types of Flow Processing Strategies?
There are six different types of Flow Processing Strategies. They are
- Asynchronous Flow Processing Strategy.
- Custom Processing Strategy.
- Thread Per Processing Strategy.
- Queued Asynchronous Flow Processing Strategy.
- Synchronous Flow Processing Strategy.
- Non-blocking Flow Processing Strategy.
- Queued Flow Processing Strategy.
How to create and consume SOAP service in Mule?
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 import Concert WSDL.
Consuming SOAP Service – We can use Web Service Consumer or CXF component in our mule flow to access/consume SOAP service.
How a message in Mule is composed?
A Mule message is composed of different parts: The payload, which is the main data content carried by the message.
The properties, which contain the meta information much like the header of a SOAP envelope or the properties of a JMS message. Optionally, multiple named attachments, to support the notion of multipart messages.
Optionally, an exception payload, which holds any error that occurred during the processing of the event.
RAML Mule Interview questions and answers
What are Inbound endpoints and Outbound endpoints in Mule ESB ?
Inbound endpoints are message sources, which as the name suggests is where message is generated and triggered. They can be created based on external events (like an incoming HTTP request or JMS message) or by a file poller.
Outbound endpoints and anything else you see in a flow (except exception strategies) are message processors which means they do something with the message in the flow
How to implement Custom Connectors in Mule ESB?
Creating Connector Project in Anypoint studio,
- Write Connector Code,
- Write Connector unit Tests (optional but recommended),
- Document the Connector for reference,
- Package the custom Connector.
How to achieve parallel processing is MuleSoft?
using scatter-gather we can implement parallel processing
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”)
}
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
How can you handle errors in the middle of the processing in MuleSoft?
You can use the Try block to handle the errors in between the flows, the 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
What are the target variables in MuleSoft?
When creating a flow in the mule app, you can store data in a variable so that any component in a flow can use it. In Mule 4 Target Variable replaces the Message Enricher of Mule 3, the target variable is available with most of the connectors
Mulesoft Dataweave Interview questions and answers
How many phases are there for batch job in Mule 4
Each batch job contains 3 different steps
- Load and Dispatch.
- Process
- On Complete.
How can you retry a failed HTTP transaction in Mule 4?
A. Using Reconnection strategy. (Read more from documentation)
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 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
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 a 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 supports the transaction when you want to handle the transaction in the 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
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.
Also Read: React Native’s New Architecture — Glossary of Terms
How can you process messages asynchronously in MuleSoft?
You can use the Async Scope to process the message asynchronously.
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 do not expect a response back
How can you achieve 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. A reliable messaging pattern is important when dealing with non-transactional endpoints
How can you improve the performance of the 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
Mulesoft Anypoint Platform Interview questions and answers
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
The flow will stop. As async scope will not return anything and Until successful will expect some response to fulfil until-successful
condition.
How will you implement caching in MuleSoft?
There are 2 ways to implement the caching in MuleSoft
- Use Object Store
- Use Cache scope to cache the Response
What is API Route Kit how it works? On what basis routing is going to happen?
APIkit Route Kit is a tool for building Mule REST API flows. By using this we can route to appropriate flow based on method name and resource.
Based on Method name and Resource name its going to route the request to particular flow.
Mulesoft Top Interview questions and answers
What is SOAP Route Kit? How the routing works in SOAP Route Kit?
SOAP Route Kit is a tool for building Mule SOAPAPI flows.
Based on Method name it’s going to route the request to particular flow.
What is the security mechanism your using to integrate Salesforce? How you got the token?
OAuth 2.0 or explain how its implemented in your project.
Difference between Object Store and VM connector and when to use what?
Object Store: An Object Store is a Mule component that allows for simple key-value storage. Although it can serve a wide variety of use cases, it is mainly design for:
- Storing synchronisation information, such as watermarks.
- Storing temporal information such as access tokens.
- Storing user information.
Virtual Machine: Virtual Machine (VM) (VM Connector) handles intra-app and inter-app communication through asynchronous queues that can be transient or persistent.
- Transient queues are faster than persistent queues, but they are not reliable in the case of a system crash.
- Persistent queues are slower but reliable.
If two services are invoked in parallel using Scatter Gather. One message got success response and one got failed with connectivity error. What will happen in scatter-gather?
The complete flow gets failed and will raise error. Based on error handing implementation it will go to error flow.
Filters are a powerful complement to the routers. Filters provide the brains routers need to make smart decisions about
what to do with messages in transit.
• Filters are used to decide on what message continues processing through a flow.
• Filtering can be done based on the message type, payload or headers.
• Payload-type-filter
– Message passes through this filter only if the payload is of a required type
• Expression Filter
– Is used to filter based on the result of a MEL expression
• Wildcard Filter
– Messages that match a shell-like wildcard will be allowed to pass.
– Is generally used for filtering text messages.
• Regular Expression Filter
– Filtering is done based on a regular expression.
– Is very useful for filtering text messages.
What is object-store
An object store is a facility for storing objects in or across Mule applications. Mule uses object stores to persist data for
eventual retrieval. Mule uses object stores in various filters, routers, and other message processors that need to store state between messages. In most cases, Mule creates and manages object stores automatically.
Why we use VM transport?
You can use 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(persistent queues are
use to help prevent data loss). Note: VM file persistency does not work on clusters. The VM transport has often been used to implement complex integrations made up of multiple applications.
VM is still useful in certain situations. Suppose, for instance, that most of the parts of your solution are local, but some
need to be decoupled for testing, or because some need to be made remote. You can use Flow References to directly reference one flow from another without a transport in the middle.use VM
transports if you need redelivery of messages, this won't be possible in private flow and flow ref because for
rollback exception strategy even if we define that no internal queue exists.
Find the latest MuleSoft(Mule 4) Articles on DataWeave, Anypoint Studio, Anypoint Platform, and Runtime Manager. Our articles also include frequently asked Mule4 Interview questions and answers. Please comment below for any queries or free article submissions.
0 Comments