mule fundamentals

18
Mule BASIC FUNDAMENTALS P r u d h v

Upload: prudhvivreddy

Post on 10-Feb-2017

391 views

Category:

Education


1 download

TRANSCRIPT

Page 1: Mule fundamentals

Prudhv

MuleBASIC FUNDAMENTALS

Page 2: Mule fundamentals

Prudhv

About Mulesoft

Mule is a lightweight integration platform Mule enables you to connect anything, anywhere. Rather

than creating multiple point-to-point integrations between systems, services, APIs, and devices, you can use Mule to intelligently manage message routing, data mapping, orchestration, reliability, security, and scalability between nodes. Plug other systems and applications into Mule and let it handle all the communication between systems, enabling you to track and monitor everything that happens

Page 3: Mule fundamentals

Prudhv

With Mule we can…….

integrate applications or systems on premise or in the cloud use connectors to create SaaS integration applications build and expose APIs and consume APIs create Web services which orchestrate calls to other services create interfaces to expose applications for mobile consumption integrate B2B with solutions that are secure, efficient, and quick

to build and deploy shift applications onto the cloud connect B2B e-commerce activities

Page 4: Mule fundamentals

Prudhv

Mule Concept

Based on the concept of Event Driven Architecture (EDA), Mule works by responding to messages initiated by external resources (i.e. events). At the simplest level, Mule applications accept and process events as messages through several message processors plugged together in a flow. Alternatively, large or streaming messages can be processed as records in a batch job. Understanding the basic flow architecture and batch job structure is key to understanding Mule. Essentially every Mule flow contains a series of message processors that accept, then process messages. Mule applications usually contain multiple linked flows and/or batch jobs, which, in combination, perform the integration required for your use case.

Page 5: Mule fundamentals

Prudhv

Flows

A flow is the construct within which you link together several individual elements to handle the receipt, processing, and eventual routing of a message. You can connect many flows together to build a complete application which you can then deploy on premise, on Mule or another application server, or in the cloud. 

At the simplest level, flows are sequences of message-processing events. A message that enters a flow may pass through a wide variety of processors. In the example diagram below, Mule receives the message through a request-response inbound endpoint, transforms the content into a new format, and processes the business logic in a component before returning a response via the message source.

Page 6: Mule fundamentals

Prudhv

Page 7: Mule fundamentals

Prudhv

Batch Jobs

A batch job is a top-level element in Mule which exists outside all Mule flows. Batch jobs split large messages into records which Mule processes asynchronously; just as flows process messages, batch jobs process records.

A batch job contains one or more batch steps which, in turn, contain any number of message processors that act upon records as they move through the batch job.

During batch processing, you can use record-level variables (recordvars) and MEL expressions to enrich, route or otherwise act upon records.

A batch job executes when triggered by either a batch executor in a Mule flow or a message source in a batch-accepting input; when triggered, Mule creates a new batch job instance. When all records have passed through all batch steps, the batch job instance ends and the batch job result can be summarized in a report to indicate which records succeeded and which failed during processing.

Page 8: Mule fundamentals

Prudhv

Page 9: Mule fundamentals

Prudhv

Message Sources

Mule processes messages initiated in external resources. Most flows or batch jobs is a receiver which receives new

messages and places them in the queue for processing. This message source receives messages from one or more external sources, thus triggering the execution of a flow or batch job.

Page 10: Mule fundamentals

Prudhv

Message Processors 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 also enables content enrichment of messages which allows you to retrieve additional data during processing and attach it to the message.

Mule uses components to conduct backend processes for specific business logic such as checking customer and inventory databases. Components route messages to the correct application, such as an order fulfillment system. Mule uses Staged Event-Driven Architecture (SEDA) for core asynchronous message processing in flows.

Importantly, components don’t have to have any Mule-specific code; they can simply be POJOs, Spring beans, Java beans, Groovy scripts, or web services containing the business logic for processing data. Components can even be developed in other languages such as Python, JavaScript, Ruby, and PHP. Mule’s catalog of building blocks support the most commonly used Enterprise Integration Patterns.

Flows and batch jobs can also include filters, scopes, and routers. When you configure the individual elements that link together to make your flow or batch job, you can

use Mule Expression Language to extract information about the message or its environment and instruct Mule to make processing decisions based on that information.

Page 11: Mule fundamentals

Prudhv

Elements in a Mule Flow

Page 12: Mule fundamentals

Prudhv

Mule Message Structure

The Mule message is the data that passes through an application via one or more flows. It consists of two main parts:

the message header, which contains metadata about the message 

the message payload, which contains your business-specific data. 

A Mule message is, itself, embedded within a Mule message object. Some Mule message objects may contain variables, attachments, and exception payloads. However, as attachments and exception payloads are not frequently used or manipulated, this overview document does not include details about them. 

Page 13: Mule fundamentals

Prudhv

Page 14: Mule fundamentals

Prudhv

Properties and Variables

The metadata contained in the message header consists of properties which provide useful information about the message. Contained within the message object, variablesrepresent data about a message. 

Properties have two main scopes: inbound and outbound. 

Page 15: Mule fundamentals

Prudhv

Outbound properties 

Inbound properties :

Page 16: Mule fundamentals

Prudhv

Variables 

Variables are user-defined metadata about a message. Variables have three scopes: 

Flow variables apply only to the flow in which they exist.  Session variables apply across all flows within the same

application.  Record variables apply to only to records processed as part of

a batch.

Page 17: Mule fundamentals

Prudhv

Message Payload

The message payload is the most important part of the Mule message because it contains the data your Mule application processes. You may apply metadata in the message header or message object to communicate information about your message.

Page 18: Mule fundamentals

Prudhv

THANK YOU