What Is Mule ?
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.
What Difficulties Mule Does Encompass?
applications can accept input from a variety of means, from the file system to the network.
speaking the right protocol is only part of the solution, as applications can use almost any form of representation for the data they exchange.
synchronous, asynchronous, or batch call semantics entail very different integration strategies.
applications of different origins that serve varied purposes tend to have disparate development, maintenance, and operational lifecycles.
Why Mule Was Designed ?
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.
Why The Name Mule ?
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.
What Are Available Esbs Apart From Mule ?
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.
What Are Differences Between Mule And Other Commercial Esbs ?
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.
What Is Model Layer In Mule ?
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.
What Is Service Layer In Mule ?
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.
What Is Transport Layer In Mule ?
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.
What Is Connector In Mule ?
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.
a JMS connector is configured with a Connection, which is shared by the different entities in charge of the actual communication.
What Is Endpoint In Mule ?
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.
What Is Transformer In Mule ?
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.
What Is Router In Mule ?
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 a 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.
What Is Filter In Mule ?
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.
What Is Component In Mule ?
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.
How 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.
What Are Configuration Builders In Mule ?
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.
Why Spring-driven Configuration Builder Is Important Than Script Builder ?
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.
What Is Bridge Component In Mule ?
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.
What Tags Are Used To Configure Spring Elements In Mule ?
Tags like <spring:bean/> <spring:entry/> etc. are used to configure spring stuff.
What Are Available Approaches Used For Modularizing Configurations In Mule ?
There are different following approaches that can be used when modularizing a configuration.
– a Mule instance can load several independent configuration files side by side.
– 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:
<model name=”myConfig” inherit=”true”>
– 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:
<spring:import resource=”instance-beans.xml” />
– 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.
Give An Example Of Stdio Connector In Mule ?
<stdio:connector name=”SystemStreamConnector” promptMessage=”Please enter something: ” messageDelayTime=”1000″/>
Give An Example Of Http Connector In Mule ?
When Does Mule Instantiates A Connector ?
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.
What Is Transport Service Descriptor In Mule ?
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 a transport.
How Many Endpoints Are There In Mule ?
There are two endpoints :
You will use inbound and outbound endpoints to communicate between components and services inside Mule as well as with the outside world.
What Is An Outbound Endpoint In Mule ?
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.
What Is Global Endpoint In Mule ?
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.
Why Does An Endpoint In Mule Offer An Address Attribute ?
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.
Give An Example Of File Endpoint In Mule ?
<file:endpoint name=”tmpPoller” path=”/tmp” fileAge=”1000″pollingFrequency=”2000″/>
What Is Streaming Property In File Connector In Mule ?
The value of this streaming property can be either true or false. If it is set to true then we are actually working on stream of file data otherwise we are working with file itself.
What Is Pollingfrequency Property In File Connector In Mule ?
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.
What Is Autodelete Property In File Connector In Mule ?
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 autoDelete property to false.
What Is Fileage Property In File Connector In Mule ?
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.
How To Send Only Certain Types Of File From One Directory To Another In Mule ?
Use the below element in file inbound to filter certain types of files.
<file:filename-wildcard-filter pattern=”file*.xml”/></file:inbound-endpoint> pattern indicates what pattern of file names should move from one directory to another directory.
What Is Vm Transport In Mule ?
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.
What Is Multicasting Router In Mule ?
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.
What Is Mule Transformer ?
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.
What Is Mule Context ?
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
What Is Payload In Mule ?
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.
What Are Different Type Of Messages In Mule ?
Pass messages from inbound to outbound routers.
Echo and log messages:
Log messages and move them from inbound to outbound routers.
Create messages from fixed or dynamic values
Do I Need An Esb?
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.
Why Mule Esb?
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.