SlideShare a Scribd company logo
MULE MESSAGE
STRUCTURE
Shanky Gupta
Introduction
■ 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.
Properties andVariables
■ The metadata contained in the message header consists of properties which
provide useful information about the message. Contained within the message
object, variables represent data about a message.
■ Properties and variables share a common format: each individual property or
variable has a name and a value. The name is how you refer to the property or
variable in Mule, and the value is the information stored within it. Thus, the
name is like a key to a door and the value is the material behind the door.
■ A message’s properties and variables have specific scopes that define and
organize how they apply across that message’s lifecycle. Properties send
metadata along with a message in order to facilitate processing and avoid
errors when the message crosses the transport barrier – either by entering a
new flow or by being transmitted to another application.
Properties scope - inbound
■ Properties have two main scopes: inbound and outbound.
■ Inbound properties are immutable, are automatically generated by the message
source and cannot be set or manipulated by the user. They contain metadata specific
to the message source that prevents scrambling of data formats or other processing
mishaps later in the message’s lifecycle. A message retains its inbound properties only
for the duration of the flow; when a message passes out of a flow, its inbound
properties do not follow it (see image below).
Properties scope - outbound
■ Outbound properties are mutable; they are set during the course of a flow and can
become inbound properties when the message passes from the outbound endpoint of
one flow to the inbound endpoint of a different flow via a transport. They contain
metadata similar to that of an inbound property, but an outbound property is applied
after the message enters the flow. Outbound properties can be set automatically by
Mule or a user can set them by manually inserting one or more transformer elements
in the flow. Note that if the message is passed to a new flow via a flow-ref rather than
a connector, the outbound properties remain outbound properties rather than being
converted to inbound properties (see image below).
Variable scope
■ 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.
■ Variables are temporary pieces of information about a message that are
meant to be used by the application that is processing it, rather than
passed along with the message to its destination. Thus, variables are
more likely to be set by humans, whereas properties are more likely to
be set and invoked by systems. However, there are no strict rules about
how properties and variables should be used.
Setting and Using Properties andVariables
■ Mule includes three message processors you can use to set, copy or remove
outbound properties and variables on a message in a flow. When you include
one of these transformers in your flow, Mule adds, copies or removes
metadata to the message header or object. (There is a fourth message
processor: the Record Variable Transformer can set or remove variables on a
record in a batch. This section, however, focuses only on message processors
which act upon messages.)
■ For example, you may want to add a property to a message to set an HTTP
transport header on your message. Alternatively, if your flow looks up an
account number associated with a user, you may want to add a variable to
your message to store the account number as metadata on the message. The
table below describes these three message processors: Property
Transformer,VariableTransformer, and SessionVariableTransformer.
Mule message structure
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 or secure it from being tampered with, but
the core of the message – the data you are transporting – is the reason the
message exists in the first place.
■ The payload doesn’t necessarily stay the same as it travels through a flow.
Various message processors in a Mule flow can affect the payload along the
way by setting it, enriching, or transforming it into a new format. You can also
extract information from a payload within a flow using a MEL expression.
Setting a Message Payload
■ Use a Set Payload message processor to completely replace the content of the
message’s payload. Enter a literal string or a Mule expression that defines the
new payload that Mule should set. The following example replaces the payload
with a string that reads "Hello, my friend!".
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:tracking……>
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8081"
doc:name="HTTP Listener Configuration"/>
<flow name="setting_propertiesFlow3" doc:name="setting_propertiesFlow3">
<http:listener config-ref="HTTP_Listener_Configuration" path="replace“
doc:name="HTTP"/>
<set-payload value=""#['Hello, my friend!']"" doc:name="Set Payload"/>
</flow>
</mule>
Enriching a Message Payload
■ In some cases, you may wish to call an external resource and use the
response to enrich the message payload, rather than replace it. To do
so, you can use a Message Enricher scope (or wrapper) to encapsulate
one or more message processors which perform the task of fetching the
information. Once obtained, Mule adds to, or enriches, the message
payload with the result of the call to the resource.

More Related Content

PPTX
Mule message structure and varibles scopes
PPTX
Mule esb2
PPTX
PPTX
Mule esb
PPT
Overview of Mule
PPT
Introduction to mule Esbs
ODP
Arch andmodulesmule
PPTX
Mule advanced
Mule message structure and varibles scopes
Mule esb2
Mule esb
Overview of Mule
Introduction to mule Esbs
Arch andmodulesmule
Mule advanced

What's hot (20)

PPTX
Mule esb transformers
PPTX
Mule ESB Tutorial Part 3
PPTX
File component in mule
PPTX
Routing in mule
PPT
mulesoft filters
PPTX
Rabbit Mq in Mule
PPT
Mule technology
PPTX
Dataweave in studio
PPTX
Mule concepts elements in a mule flow
PPTX
Choice router mule
PPTX
Design flows in mule
PPTX
Mule esb parts
ODP
Mule Complete Training
PPTX
Muleflowarchitecture
PPTX
Mule high availability
PPT
Mule healthcare toolkit
PPT
Implementing an Esb using Mule
PPTX
Mule Collection Aggregator
PPTX
Mule ESB Components
PPTX
Mule rabbitmq
Mule esb transformers
Mule ESB Tutorial Part 3
File component in mule
Routing in mule
mulesoft filters
Rabbit Mq in Mule
Mule technology
Dataweave in studio
Mule concepts elements in a mule flow
Choice router mule
Design flows in mule
Mule esb parts
Mule Complete Training
Muleflowarchitecture
Mule high availability
Mule healthcare toolkit
Implementing an Esb using Mule
Mule Collection Aggregator
Mule ESB Components
Mule rabbitmq
Ad

Viewers also liked (20)

PPTX
Mule message structure
PPTX
Configuring Anypoint Studio MQ connector
PPTX
Invoke component
PPTX
PPTX
Cloud hub architecture
PDF
OAuth 2.0 authentication
PPTX
Cloudhub fabric
PPTX
Mule tcat server - Server profiles
PPTX
MUnit run and wait scope
PDF
VYATTA USERS MEETING Spring 2014
PPTX
Using mule with web services
PPTX
CloudHub networking guide
PPTX
Java-JSON-Jackson
PPTX
Java component
PPTX
Mule message
PPTX
Web services
PPTX
Mule_Portal
ODP
Mule esb domain
PPTX
Mule Cloud Connectors-Save and Load OAuth
Mule message structure
Configuring Anypoint Studio MQ connector
Invoke component
Cloud hub architecture
OAuth 2.0 authentication
Cloudhub fabric
Mule tcat server - Server profiles
MUnit run and wait scope
VYATTA USERS MEETING Spring 2014
Using mule with web services
CloudHub networking guide
Java-JSON-Jackson
Java component
Mule message
Web services
Mule_Portal
Mule esb domain
Mule Cloud Connectors-Save and Load OAuth
Ad

Similar to Mule message structure (20)

PPTX
Message structure
PPTX
Mule message
PPTX
Mule message
PPTX
Message structure
PPTX
Mule concepts
PPTX
Mule chapter2
PPTX
Message state
PPTX
Mule esb
PPTX
Mule esb
PPTX
Mule enterprise service introduction
PPTX
Mule message
PPTX
Mule esb
PPTX
Mule esb
PPTX
Niranjan mule esb
PPTX
Mule esb naveen
PPTX
Introduction to Mule ESB
PPTX
Mule message state
PPTX
PPTX
Ashok mule esb
PPTX
Mule slides
Message structure
Mule message
Mule message
Message structure
Mule concepts
Mule chapter2
Message state
Mule esb
Mule esb
Mule enterprise service introduction
Mule message
Mule esb
Mule esb
Niranjan mule esb
Mule esb naveen
Introduction to Mule ESB
Mule message state
Ashok mule esb
Mule slides

More from Shanky Gupta (20)

PPTX
Mule tcat server - common problems and solutions
PPTX
Anypoint access management - Roles
PPTX
Mule access management - Managing Environments and Permissions
PPTX
Mule: Munit domain support
PPTX
Mule tcat server - Monitoring a server
PPTX
Mule tcat server - Monitoring applications
PPTX
Mule tcat server - deploying applications
PPTX
Mule tcat server - automating tasks
PPTX
Mule agent notifications
PPTX
Mule management console Architecture
PPTX
MUnit matchers
PPTX
MuleSoft CloudHub FAQ
PPTX
Mule management console
PPTX
Cloudhub and Mule
PPTX
Mule Security
PPTX
Anypoint access management - Users
PPTX
Anypoint access management
PPTX
The Mule Agent
PPTX
MUnit - Testing Mule
PPTX
Mule testing
Mule tcat server - common problems and solutions
Anypoint access management - Roles
Mule access management - Managing Environments and Permissions
Mule: Munit domain support
Mule tcat server - Monitoring a server
Mule tcat server - Monitoring applications
Mule tcat server - deploying applications
Mule tcat server - automating tasks
Mule agent notifications
Mule management console Architecture
MUnit matchers
MuleSoft CloudHub FAQ
Mule management console
Cloudhub and Mule
Mule Security
Anypoint access management - Users
Anypoint access management
The Mule Agent
MUnit - Testing Mule
Mule testing

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PPT
Teaching material agriculture food technology
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Encapsulation theory and applications.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Machine learning based COVID-19 study performance prediction
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Approach and Philosophy of On baking technology
Teaching material agriculture food technology
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Review of recent advances in non-invasive hemoglobin estimation
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Reach Out and Touch Someone: Haptics and Empathic Computing
Chapter 3 Spatial Domain Image Processing.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
NewMind AI Weekly Chronicles - August'25 Week I
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Encapsulation theory and applications.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Machine learning based COVID-19 study performance prediction
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

Mule message structure

  • 2. Introduction ■ 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.
  • 3. Properties andVariables ■ The metadata contained in the message header consists of properties which provide useful information about the message. Contained within the message object, variables represent data about a message. ■ Properties and variables share a common format: each individual property or variable has a name and a value. The name is how you refer to the property or variable in Mule, and the value is the information stored within it. Thus, the name is like a key to a door and the value is the material behind the door. ■ A message’s properties and variables have specific scopes that define and organize how they apply across that message’s lifecycle. Properties send metadata along with a message in order to facilitate processing and avoid errors when the message crosses the transport barrier – either by entering a new flow or by being transmitted to another application.
  • 4. Properties scope - inbound ■ Properties have two main scopes: inbound and outbound. ■ Inbound properties are immutable, are automatically generated by the message source and cannot be set or manipulated by the user. They contain metadata specific to the message source that prevents scrambling of data formats or other processing mishaps later in the message’s lifecycle. A message retains its inbound properties only for the duration of the flow; when a message passes out of a flow, its inbound properties do not follow it (see image below).
  • 5. Properties scope - outbound ■ Outbound properties are mutable; they are set during the course of a flow and can become inbound properties when the message passes from the outbound endpoint of one flow to the inbound endpoint of a different flow via a transport. They contain metadata similar to that of an inbound property, but an outbound property is applied after the message enters the flow. Outbound properties can be set automatically by Mule or a user can set them by manually inserting one or more transformer elements in the flow. Note that if the message is passed to a new flow via a flow-ref rather than a connector, the outbound properties remain outbound properties rather than being converted to inbound properties (see image below).
  • 6. Variable scope ■ 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. ■ Variables are temporary pieces of information about a message that are meant to be used by the application that is processing it, rather than passed along with the message to its destination. Thus, variables are more likely to be set by humans, whereas properties are more likely to be set and invoked by systems. However, there are no strict rules about how properties and variables should be used.
  • 7. Setting and Using Properties andVariables ■ Mule includes three message processors you can use to set, copy or remove outbound properties and variables on a message in a flow. When you include one of these transformers in your flow, Mule adds, copies or removes metadata to the message header or object. (There is a fourth message processor: the Record Variable Transformer can set or remove variables on a record in a batch. This section, however, focuses only on message processors which act upon messages.) ■ For example, you may want to add a property to a message to set an HTTP transport header on your message. Alternatively, if your flow looks up an account number associated with a user, you may want to add a variable to your message to store the account number as metadata on the message. The table below describes these three message processors: Property Transformer,VariableTransformer, and SessionVariableTransformer.
  • 9. 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 or secure it from being tampered with, but the core of the message – the data you are transporting – is the reason the message exists in the first place. ■ The payload doesn’t necessarily stay the same as it travels through a flow. Various message processors in a Mule flow can affect the payload along the way by setting it, enriching, or transforming it into a new format. You can also extract information from a payload within a flow using a MEL expression.
  • 10. Setting a Message Payload ■ Use a Set Payload message processor to completely replace the content of the message’s payload. Enter a literal string or a Mule expression that defines the new payload that Mule should set. The following example replaces the payload with a string that reads "Hello, my friend!". <?xml version="1.0" encoding="UTF-8"?> <mule xmlns:tracking……> <http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8081" doc:name="HTTP Listener Configuration"/> <flow name="setting_propertiesFlow3" doc:name="setting_propertiesFlow3"> <http:listener config-ref="HTTP_Listener_Configuration" path="replace“ doc:name="HTTP"/> <set-payload value=""#['Hello, my friend!']"" doc:name="Set Payload"/> </flow> </mule>
  • 11. Enriching a Message Payload ■ In some cases, you may wish to call an external resource and use the response to enrich the message payload, rather than replace it. To do so, you can use a Message Enricher scope (or wrapper) to encapsulate one or more message processors which perform the task of fetching the information. Once obtained, Mule adds to, or enriches, the message payload with the result of the call to the resource.