Mule ESB Interview Questions

Q.What Is Mule? Ans: Mule is a lightweight event-driven enterprise service bus (ESB) and an integration platform. It is a lightweight and modular solution that could scale from an application-level messaging framework to an enterprise-wide highly distributable object broker. Q.What Difficulties Mule Does Encompass? Ans: Transport: applications can accept input from a variety of means, from the file system to the network. Data format: speaking the right protocol is only part of the solution, as applications can use almost any form of representation for the data they exchange. Invocation styles: synchronous, asynchronous, or batch call semantics entail very different integration strategies. Lifecycles: applications of different origins that serve varied purposes tend to have disparate development, maintenance, and operational lifecycles. Q. Why Mule Was Designed? Ans: Mule’s core was designed as an event-driven framework combined with a unified representation of messages, expandable with pluggable modules. These modules would provide support for a wide range of transports or add extra features, such as distributed transactions, security, or management. Mule was also designed as a programmatic framework offering programmers the means to graft additional behavior such as specific message processing or custom data transformation. Q. Why The Name Mule? Ans: There is a lot of infrastructure work to be done before we can really start thinking about implementing any logic. So this infrastructure work is regarded as “donkey work” as it needs doing for every project. A Mule is also commonly referred to as a carrier of load, moving it from one place to another. The load it specializes in moving is our enterprise information. Q. What Are Available Esbs Apart From Mule? Ans: All major JEE vendors (BEA, IBM, Oracle, Sun) have an ESB in their catalog. It is unremarkably based on their middleware technologies and is usually at the core of a much broader SOA product suite. There are also some commercial ESBs that have been built by vendors not in the field of JEE application servers, like the ones from Progress Software, IONA Technologies, and Software AG. Q. What Are Differences Between Mule And Other Commercial Esbs? Ans: Prescriptive deployment model, whereas Mule supports a wide variety of deployment strategies. Prescriptive SOA methodology, whereas Mule can embrace the architectural style and SOA practices in place where it is deployed. Mainly focused on higher-level concerns, whereas Mule deals extensively with all the details of integration. Strict full-stack web service orientation, whereas Mule’s capacities as an integration framework open it to all sorts of other protocols. Comprehensive documentation, a subject on which MuleSource has made huge progress recently. Q. What Is Model Layer In Mule? Ans: The first logical layer is the model layer. A Mule model represents the runtime environment that hosts services. It defines the behavior of Mule when processing requests handled by services. The model provides services with supporting features, such as exception strategies. It also provides services with default values that simplify their configuration. Q. What Is Service Layer In Mule? Ans: A Mule service is composed of all the Mule entities involved in processing particular requests in predefined manners.A service is defined by a specific configuration. This configuration determines the different elements, from the different layers of responsibility, that will be mobilized to process the requests that it will be open to receive. Depending on the type of input channel it uses, a service may or may not be publicly accessible outside of the ESB. Q. What Is Transport Layer In Mule? Ans: The transport layer is in charge of receiving or sending messages. This is why it is involved with both inbound and outbound communications. A transport manifests itself in the configuration by the following elements: connectors, endpoints and transformers. A transport also defines one message adapter. A message adapter is responsible for extracting all the information available in a particular request (data, meta information, attachments, and so on) and storing them in transport-agnostic fashion in a Mule message. Q. What Is Connector In Mule? Ans: 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 is configured with a Connection, which is shared by the different entities in charge of the actual communication. Q. What Is Endpoint In Mule? Ans: An endpoint represents the specific usage of a protocol, whether it is for listening/polling, reading from, or writing to a particular target destination. Hence it controls what underlying entities will be used with the connector they depend on. The target destination itself is defined as a URI. Depending on the connector, the URI will bear a different meaning; for example, it can represent a URL or a JMS destination. Q. What Is the Transformer In Mule? Ans: A transformer takes care of translating the content of a message from one form to another. It is possible to chain transformers to cumulate their effects. Transformers can kick in at different stages while a message transits through a service. Q. What Is Router In Mule? Ans: Routers play a crucial role in controlling the trajectory a message will follow when it transits in Mule. They are the gatekeepers of the endpoints of service, taking care of keeping messages on the right succession of tracks so they can reach their intended destinations. Certain routers act like the big classification yards: they can split, sort, or regroup messages based on certain conditions. Q. What Is Filter In Mule? Ans: 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. Some filters go as far as deeply analyzing the content of a message for a particular value on which their outcome will be based. Q. What Is Component In Mule ? Ans: Components are the centerpiece of Mule’s services. Each service is organized with a component at its core and inbound and outbound routers around it. Components are used to implement a specific behavior in a service. This behavior can be as simple as logging messages or can go as far as invoking other services. Components can also have no behavior at all; in that case they are pass-through and make the service act as a bridge between its inbound and outbound routers. Q. How Message In Mule Is Composed ? Ans: 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. Q. What Are Configuration Builders In Mule ? Ans: Mule uses configuration builders that can translate a human-authored configuration file into the complex graph of objects that constitutes a running node of this ESB. The main builders are of two kinds: a Spring-driven builder, which works with XML files, and a script builder, which can accept scripting language files. Q. Why Spring-driven Configuration Builder Is Important Than Script Builder? Ans: The advantages of Spring-driven configuration builder It is the most popular — you are more likely to find examples using this syntax. It is the most user friendly — Spring takes care of wiring together all the moving parts of the ESB, something you must do by hand with a script builder. It is the most expressive — dedicated XML schemas define the domain-specific language of Mule, allowing you to handle higher-level concepts than the scripting approach does. Q. What Is Bridge Component In Mule? Ans: A bridge component is used to pass the messages from the inbound router to the outbound one. A bridge is a neutral component: it does not perform any action or modify messages that it processes. Q. What Tags Are Used To Configure Spring Elements In Mule? Ans : Tags like etc. are used to configure spring stuff. Q. What Are Available Approaches Used For Modularizing Configurations In Mule ? Ans: There are different following approaches that can be used when modularizing a configuration. Independent configurations – a Mule instance can load several independent configuration files side by side. Inherited configurations – main idea is to express a formal parent-child dependency between two configurations. By strongly expressing this dependency, you will have the guarantee at boot time that no configuration file has been omitted. Simply by using the same name for the parent and child models and by flagging the child as being an heir, as shown here:     Imported configurations – You can easily import external Spring application context files into your Mule configuration files. The following illustrates how instance.xml would import its Spring context file:       Heterogeneous configurations – It is possible to mix several styles of Mule configuration in an instance. An instance can be configured with a Groovy script and Spring XML configuration builders. Q. Give An Example Of Studio Connector In Mule? Ans: Q. Give An Example Of Http Connector In Mule? Ans: Q. When Does Mule Instantiate A Connector? Ans: If Mule figures out that one of our endpoints needs a particular connector, it will automatically instantiate one for us, using all the default values for its different configuration parameters. This is a perfectly viable approach if we are satisfied with the behavior of the connector when it uses its default configuration. This is often the case for the VM or HTTP transports. Note that Mule will name these default connectors with monikers such as connector.http.0. Q. What Is Transport Service Descriptor In Mule ? Ans: The connector has a technical configuration known as the Transport Service Descriptor (TSD). This hidden configuration is automatically used for each instance of the connector. It defines technical parameters such as what classes to use for the message receivers, requesters, and dispatchers; or the default transformers to use in inbound, outbound, and response routers. Knowing these default values is essential to grasping the behavior of transport. Q. How Many Endpoints Are There In Mule ? Ans: There are two endpoints : inbound outbound. You will use inbound and outbound endpoints to communicate between components and services inside Mule as well as with the outside world. Q. What Is An Outbound Endpoint In Mule ? Ans: Outbound endpoints are used to send data. An outbound endpoint is used to do things such as send SOAP messages, write to file streams, and send email messages. Q. What Is Global Endpoint In Mule ? Ans: An endpoint destination that is shared by several routers, it is worth creating a global endpoint. A global endpoint is not typified for inbound or outbound routing, making it usable in many different places in a configuration file. It must be named so it can actually be used in a service, which will reference the global endpoint by its name. A global endpoint can also help clarify the usage of a particular destination. Q. Why Does An Endpoint In Mule Offer An Address Attribute ? Ans: This allows us to configure a generic endpoint using the Mule 1.x style of URI-based destination addresses instead of the dedicated attributes of the specific endpoint element. Q. Give An Example Of File Endpoint In Mule? Ans: Q. What Is Streaming Property In File Connector In Mule? Ans: The value of this streaming property can be either true or false. If it is set to true then we are actually working on a stream of file data otherwise we are working with the file itself. Q. What Is Polling frequency Property In File Connector In Mule? Ans: When we want file inbound endpoints to poll their source directories for new content. This is accomplished by setting the pollingFrequency to some milliseconds value. Q. What Is Autodelete Property In File Connector In Mule? Ans: The default value of autoDelete is true. Therefore, a file inbound endpoint will, by default, remove the file from the source directory once it is read by the inbound endpoint. If you do not want to delete file automatically then you can set an autoDelete property to false. Q. What Is Fileage Property In File Connector In Mule? Ans: The fileAge property specifies how long the endpoint should wait before reading the file again. For instance, a fileAge of 60000 indicates Mule should wait a minute before processing the file again. Q. How To Send Only Certain Types Of File From One Directory To Another In Mule? Ans: Use the below element in file inbound to filter certain types of files. pattern indicates what pattern of file names should move from one directory to another directory. Q. What Is Vm Transport In Mule? Ans: The VM transport is a special kind of transport that you’ll use to send messages via memory. These messages never leave the JVM the Mule instance is running in. Q. What Is Multicasting Router In Mule? Ans: The multicasting router can send messages to multiple endpoints over different transports. The multicasting router allows you to easily move the same messages across these different endpoints. Q. What Is a Mule Transformer? Ans: It is an event, more specifically an instance of org.mule.api.MuleEvent. This object carries not only the actual content of the message but also the context of the event. Q. What Is a Mule Context? Ans: The Mule context is composed of references to different objects, including security credentials, if any, the session in which the request is processed. All internals of the ESB are accessible through Mule context Q. What Is Payload In Mule? Ans: The content of a message, also known as payload. It is wrapped in an instance of org.mule.api.MuleMessage, which provides different means of accessing the payload under different forms. A MuleMessage also contains properties, much like the header of a SOAP envelope or the properties of a JMS message, and can also have multiple named attachments. Q. What Are Different Type Of Messages In Mule? Ans: Bridge messages: Pass messages from inbound to outbound routers. Echo and log messages: Log messages and move them from inbound to outbound routers. Build messages: Create messages from fixed or dynamic values Q. Do I Need An ESB? Ans: Mule and other ESBs offer real value in scenarios where there are at least a few integration points or at least 3 applications to integrate. They are also well suited to scenarios where loose coupling, scalability and robustness are required. Q. Why Mule ESB? Ans: Mule ESB is lightweight but highly scalable, allowing you to start small and connect more applications over time. Mule manages all the interactions between applications and components transparently, regardless of whether they exist in the same virtual machine or over the Internet, and regardless of the underlying transport protocol used. There are currently several commercial ESB implementations on the market. However, many of these provide limited functionality or are built on top of an existing application server or messaging server, locking you into that specific vendor. Mule is vendor-neutral, so different vendor implementations can plug in to it. You are never locked in to a specific vendor when you use Mule. Contact for more on Mule ESB Online Training