Mule Concepts
Flows and Batch Jobs
• Based on the concept of Event Driven Architecture
(EDA).
• Works by responding to messages initiated by
external resources (such as, events).
• Mule applications accept and process events
as messages through several message processors
plugged together in a flow.
• Large or streaming messages can be processed
as records in a batch job.
Mule Concepts : Intro
• 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.
• These applications perform the integration required
for the use case.
Mule Concepts : Intro
Mule Concepts : Intro
• Every Mule Applications can consists of below :
– Flows
– Batch Jobs
Mule Concepts : 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.
• Flows are sequences of message-processing events.
• A message that enters a flow may pass through a
wide variety of processors.
• Multiple flows can be connected together to build a
complete application.
Mule Concepts : Flows
• As shown in below diagram, each flow consists of:
– Message Source
– Message Processors
Mule Concepts : Batch Jobs
• A top-level element in Mule that exists outside all
Mule flows.
• provides record I/O for Mule message processing.
• Batch jobs split large messages into records which
Mule processes asynchronously.
• Just as flows process messages, batch jobs process
records.
Mule Concepts : Batch Jobs
• Contains one or more batch steps.
• Each batch step contains any number of message
processors that act upon records as they move
through the batch job.
• record-level variables (recordVars) and MEL (Mule
Expression Language) expressions to enrich, route or
otherwise act upon records.
Mule Concepts : Batch Jobs
• A batch job is executes when :
– Triggered by a batch executor in a Mule flow, or
– Message source in a batch-accepting input.
• When triggered, Mule creates a new batch job
instance.
• Once every record has passed through all batch
steps, the batch job instance ends and the batch job
result can be summarized in a report.
• Report indicates which records succeeded and which
failed.
Mule Concepts : Message Sources
• Mule processes messages, also known as events,
which may be transmitted from resources external to
Mule.
• First building block of most flows or batch jobs is a
message receiver.
• Receiver receives new messages and places them in
the queue for processing.
• These Receivers are the Message Sources.
• Message Sources on receiving of the messages from
one or more external sources trigger the execution of
the flow or the batch job.
Mule Concepts : Message Sources
• Message sources in Mule are usually Anypoint
Connectors.
• Anypoint Connectors elements provide
connectivity to a specific external source.
• The connectivity is provided via a standard
protocol (such as HTTP, FTP, SMTP) or a third-
party API (such as Salesforce.com, Twitter, or
MongoDB.)
Mule Concepts : Message Processors
• Mule processors are the elements which acts on the
received messages and perform operations to modify
the message or to create a new one.
• In Mule, message processors are grouped together
by category.
Mule Concepts : Message Processors
• Message Processors are grouped in below categories:
– Message Transformers :
• key to exchanging data between nodes
• Allow Mule to convert message payload data to a format that another application
can understand.
• Through Message Enrichers Mule enables to retrieve additional data during
processing and attach it to the message.
– Components :
• To conduct backend processes for specific business logic.
• Components route messages to the correct application.
• 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 Concepts : Message Processors
• Message Processors are grouped in below categories:
– Filters :
• To filter out the messages based on the set criteria.
– Scopes :
• To "wrap" around several message processors together as a single unit.
E.g. Cache the result of the processing they perform
– Routers :
• To send messages down different paths in your application depending on the
content of the message payload.
– Mainly Mule Expression Language is used to
extract information about the message or its
environment and instruct Mule to make
processing decisions based on that information.

Mule concepts flows

  • 1.
  • 2.
    • Based onthe concept of Event Driven Architecture (EDA). • Works by responding to messages initiated by external resources (such as, events). • Mule applications accept and process events as messages through several message processors plugged together in a flow. • Large or streaming messages can be processed as records in a batch job. Mule Concepts : Intro
  • 3.
    • Every Muleflow contains a series of message processors that accept, then process messages. • Mule applications usually contain multiple linked flows and/or batch jobs. • These applications perform the integration required for the use case. Mule Concepts : Intro
  • 4.
    Mule Concepts :Intro • Every Mule Applications can consists of below : – Flows – Batch Jobs
  • 5.
    Mule Concepts :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. • Flows are sequences of message-processing events. • A message that enters a flow may pass through a wide variety of processors. • Multiple flows can be connected together to build a complete application.
  • 6.
    Mule Concepts :Flows • As shown in below diagram, each flow consists of: – Message Source – Message Processors
  • 7.
    Mule Concepts :Batch Jobs • A top-level element in Mule that exists outside all Mule flows. • provides record I/O for Mule message processing. • Batch jobs split large messages into records which Mule processes asynchronously. • Just as flows process messages, batch jobs process records.
  • 8.
    Mule Concepts :Batch Jobs • Contains one or more batch steps. • Each batch step contains any number of message processors that act upon records as they move through the batch job. • record-level variables (recordVars) and MEL (Mule Expression Language) expressions to enrich, route or otherwise act upon records.
  • 9.
    Mule Concepts :Batch Jobs • A batch job is executes when : – Triggered by a batch executor in a Mule flow, or – Message source in a batch-accepting input. • When triggered, Mule creates a new batch job instance. • Once every record has passed through all batch steps, the batch job instance ends and the batch job result can be summarized in a report. • Report indicates which records succeeded and which failed.
  • 10.
    Mule Concepts :Message Sources • Mule processes messages, also known as events, which may be transmitted from resources external to Mule. • First building block of most flows or batch jobs is a message receiver. • Receiver receives new messages and places them in the queue for processing. • These Receivers are the Message Sources. • Message Sources on receiving of the messages from one or more external sources trigger the execution of the flow or the batch job.
  • 11.
    Mule Concepts :Message Sources • Message sources in Mule are usually Anypoint Connectors. • Anypoint Connectors elements provide connectivity to a specific external source. • The connectivity is provided via a standard protocol (such as HTTP, FTP, SMTP) or a third- party API (such as Salesforce.com, Twitter, or MongoDB.)
  • 12.
    Mule Concepts :Message Processors • Mule processors are the elements which acts on the received messages and perform operations to modify the message or to create a new one. • In Mule, message processors are grouped together by category.
  • 13.
    Mule Concepts :Message Processors • Message Processors are grouped in below categories: – Message Transformers : • key to exchanging data between nodes • Allow Mule to convert message payload data to a format that another application can understand. • Through Message Enrichers Mule enables to retrieve additional data during processing and attach it to the message. – Components : • To conduct backend processes for specific business logic. • Components route messages to the correct application. • 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.
  • 14.
    Mule Concepts :Message Processors • Message Processors are grouped in below categories: – Filters : • To filter out the messages based on the set criteria. – Scopes : • To "wrap" around several message processors together as a single unit. E.g. Cache the result of the processing they perform – Routers : • To send messages down different paths in your application depending on the content of the message payload. – Mainly Mule Expression Language is used to extract information about the message or its environment and instruct Mule to make processing decisions based on that information.