SlideShare a Scribd company logo
Mule Message
| ©2013, Cognizant
1
Mule Properties and FlowVariables are one of the most widely used features in Mule.
Nevertheless, Mule newcomers may have a hard time understanding how the different
property scopes and variables compare to each other, and how to choose the right one for
their use cases.
Messaging Framework
 A message is simply a packet of data that can be handled and sent between
applications on a specific channel (also called a queue).
 Many applications don't have the ability to read or process data coming from
another application.
 Mule ESB solves this problem by providing a messaging framework that reads,
transforms, and sends data as messages between applications.
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
very much like the header of a SOAP envelope or the
properties of a JMS message.
 If required, a series of attachments that can
accompany the message
Mule vs. Traditional ESB
 Difference between Mule and a traditional ESB is that Mule only converts data as
needed.
 Traditional ESB
 Need to create an adapter for every application, connect to the bus and convert
the application's data into a single common messaging format.
 To develop adapter and process message require a lot of time.
 Mule ESB
 Mule eliminates all these efforts.
 Mule increases performance and reduces development time over a traditional
ESB.
Messaging styles
One-way
 Receives a message and puts it on a SEDA queue.
 The calling thread returns and the message is processed by the SEDA thread
pool. Nothing gets returned from the result of the call.
 The Mule service must have an asynchronous inbound endpoint.
 If an error occurs it is handled by the Mule server.
 One-Way return types are NullPayloads
Messaging styles - contd
Request – Response
 Receives a message and the component returns a message.
 If the component call returns null, then a Mule Message with a NullPayload is
returned.
 If the call method is void the request message is returned.
 The Mule service must have a synchronous inbound endpoint and no outbound
endpoint configured.
Messaging styles - contd
6
Synchronous
 A message is now processed synchronously if one of the following is true:
 endpoint is request-response
 A transaction is active
 The message property MULE_FORCE_SYNC is set to TRUE
 Receives a message and the component processes before sending it out on
another endpoint. The request happens in the same thread.
 Mule blocks on the outbound endpoint to wait for a response from the remote
application (if applicable) until the responseTimeout threshold is reached. If no
response is received, it returns null.
 A synchronous call always returns a result, even if there is an outbound
endpoint.
7
Messaging styles - contd
Async Request Response
 This pattern allows the back-end process to be forked to invoke other services
and return a result based on the results of multiple service invocations.
 The Async Reply Router is used to listen on a Reply To endpoint for results.
 Set the reply-to address on the outbound router, and set the <async-reply>
element to listen on that reply endpoint.
Message scope
Inbound
 Inbound properties scope will hold the headers/properties sent by the caller
flow/service/external source.
 When a message arrives to a mule endpoint it can contain headers/properties.
Those properties will be placed as inbound properties of the mule message.
 Inbound message properties are read only.
Outbound
 Outbound properties scope will contain all the properties that will be deliver
together with the message payload when calling an outbound endpoint.
 When a message is deliver to another endpoint then all the properties in
outbound scope will be sent together with the message as headers.
 After calling an outbound endpoint that returns a response outbound properties
are lost.
Message scope - contd
Message scope - contd
 Invocation
 An Invocation property will be present in the invoked flow and will last for all the
flow execution.
 Invocation properties are not propagated to other flows, but will be propagated
if another flow or sub-flow is called using flow-ref.
 Session
 Mule session scope is created when a message enters a mule flow/service and it
will preserved until the message leaves mule.
 Mule session propagation is done only when mule endpoints transport supports
message headers (i.e. JMS, HTTP, VM).
 Any change to those properties within the async flow will not be reflected in the
caller flow.
 Application
 Application properties scope is tied to the application lifecycle
 Application properties are read only.
Sample Code – Inbound Scope
Sample Code – Outbound Scope
Sample Code – Invocation Scope

More Related Content

PPTX
Mule integration
PPTX
How muleworks
PPTX
Send email attachment using smtp in mule esb
PPTX
Mule advanced
PPTX
Core concepts in mule
PPTX
Mule esb mule message
PPTX
Webservice vm in mule
PPTX
Mule requester
Mule integration
How muleworks
Send email attachment using smtp in mule esb
Mule advanced
Core concepts in mule
Mule esb mule message
Webservice vm in mule
Mule requester

What's hot (17)

PPTX
Mule esb parts
PPTX
Scatter gather flow in mule
PPTX
Vm component in mule demo
PPTX
Send email attachment using smtp in mule esb
PPTX
Connectors in mule
PPTX
Web service vm in mule
PPTX
Send email attachment using smtp in mule esb
PPTX
Mule concepts
PPTX
Send email attachment using smtp in mule esb
PPTX
Testing mule
PPTX
Design flows in mule
PPTX
Expression language
PPTX
MuleSoft Consuming Soap Web Service - CXF Proxy-Client Module
PPTX
Mulesoft idempotent Message Filter
PPTX
Mule Jetty transport
PPTX
Mule velocity
PPTX
Mule esb
Mule esb parts
Scatter gather flow in mule
Vm component in mule demo
Send email attachment using smtp in mule esb
Connectors in mule
Web service vm in mule
Send email attachment using smtp in mule esb
Mule concepts
Send email attachment using smtp in mule esb
Testing mule
Design flows in mule
Expression language
MuleSoft Consuming Soap Web Service - CXF Proxy-Client Module
Mulesoft idempotent Message Filter
Mule Jetty transport
Mule velocity
Mule esb
Ad

Viewers also liked (20)

PPTX
Mule message processor or routers
PPTX
Mule sap connector
PPTX
Mule soa
PPTX
Mule any point studio
PPTX
Mulesoft intergrate for android app
PPTX
Mule esb
PPTX
Using groovy in mule
PPTX
Running mule standalone
PPTX
Mule enterprise service introduction
PPTX
Cloud hub with mule
PPTX
Runing batch job in mule
PPTX
Xslt with mule
PPTX
Mule high availability
PPTX
Sap integration by mule esb
PPTX
Query in share point by mule
PPTX
Logging configuration in mule
PPTX
Rest security in mule
PPTX
Mule esb basic introduction
PPTX
Mule flow complete
PPTX
Retrieve microsoft data
Mule message processor or routers
Mule sap connector
Mule soa
Mule any point studio
Mulesoft intergrate for android app
Mule esb
Using groovy in mule
Running mule standalone
Mule enterprise service introduction
Cloud hub with mule
Runing batch job in mule
Xslt with mule
Mule high availability
Sap integration by mule esb
Query in share point by mule
Logging configuration in mule
Rest security in mule
Mule esb basic introduction
Mule flow complete
Retrieve microsoft data
Ad

Similar to Mule message (20)

PPTX
PPTX
Mule architecture
PPTX
Mule architecture
PPTX
Mule fundamentals
PDF
Mulesoft ppt
PPTX
PPTX
Mule esb
PPTX
Mule esb
PPTX
Using flows for service orchestration
PPTX
Service orchestration by using flows
PPTX
Service orchestration by using flows
PDF
Mule esb and_relevant_components
PPTX
Mule requestor component
PPT
Mule esb presentation 2015
ODP
Apache ActiveMQ and Apache Camel
PPTX
Mule concepts flows
PPTX
Mule core concepts
PPTX
Mule esb kranthi
PPTX
Mule esb kranthi
Mule architecture
Mule architecture
Mule fundamentals
Mulesoft ppt
Mule esb
Mule esb
Using flows for service orchestration
Service orchestration by using flows
Service orchestration by using flows
Mule esb and_relevant_components
Mule requestor component
Mule esb presentation 2015
Apache ActiveMQ and Apache Camel
Mule concepts flows
Mule core concepts
Mule esb kranthi
Mule esb kranthi

More from Son Nguyen (20)

PPTX
Wsdl connector introduction
PPTX
Android intergrate with mule
PPTX
Mule flow overview
PPTX
Mule flow and filter
PPTX
Handle exceptions in mule
PPT
Spring security integrate with mule
PPTX
Message processor in mule
PPTX
Expression language in mule
PPTX
Mule with data weave
PPTX
Using spring scheduler mule
PPTX
Composite source in bound and out-bound
PPT
Batch job processing
PPTX
Using message enricher
PPT
Finance connectors with mule
PPT
Google drive connection
PPTX
Using properties in mule
PPT
Mule integrate with microsoft
PPTX
Jms queue
PPT
Anypoint connectors
PPT
Mule integration with cloud hub
Wsdl connector introduction
Android intergrate with mule
Mule flow overview
Mule flow and filter
Handle exceptions in mule
Spring security integrate with mule
Message processor in mule
Expression language in mule
Mule with data weave
Using spring scheduler mule
Composite source in bound and out-bound
Batch job processing
Using message enricher
Finance connectors with mule
Google drive connection
Using properties in mule
Mule integrate with microsoft
Jms queue
Anypoint connectors
Mule integration with cloud hub

Recently uploaded (20)

PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPT
Teaching material agriculture food technology
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Encapsulation theory and applications.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
A Presentation on Artificial Intelligence
PDF
KodekX | Application Modernization Development
PDF
Modernizing your data center with Dell and AMD
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Cloud computing and distributed systems.
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Big Data Technologies - Introduction.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Teaching material agriculture food technology
Digital-Transformation-Roadmap-for-Companies.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Encapsulation theory and applications.pdf
Approach and Philosophy of On baking technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Network Security Unit 5.pdf for BCA BBA.
Spectral efficient network and resource selection model in 5G networks
Unlocking AI with Model Context Protocol (MCP)
A Presentation on Artificial Intelligence
KodekX | Application Modernization Development
Modernizing your data center with Dell and AMD
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
MYSQL Presentation for SQL database connectivity
Cloud computing and distributed systems.
Encapsulation_ Review paper, used for researhc scholars
Big Data Technologies - Introduction.pptx
NewMind AI Weekly Chronicles - August'25 Week I

Mule message

  • 2. | ©2013, Cognizant 1 Mule Properties and FlowVariables are one of the most widely used features in Mule. Nevertheless, Mule newcomers may have a hard time understanding how the different property scopes and variables compare to each other, and how to choose the right one for their use cases.
  • 3. Messaging Framework  A message is simply a packet of data that can be handled and sent between applications on a specific channel (also called a queue).  Many applications don't have the ability to read or process data coming from another application.  Mule ESB solves this problem by providing a messaging framework that reads, transforms, and sends data as messages between applications. 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 very much like the header of a SOAP envelope or the properties of a JMS message.  If required, a series of attachments that can accompany the message
  • 4. Mule vs. Traditional ESB  Difference between Mule and a traditional ESB is that Mule only converts data as needed.  Traditional ESB  Need to create an adapter for every application, connect to the bus and convert the application's data into a single common messaging format.  To develop adapter and process message require a lot of time.  Mule ESB  Mule eliminates all these efforts.  Mule increases performance and reduces development time over a traditional ESB.
  • 5. Messaging styles One-way  Receives a message and puts it on a SEDA queue.  The calling thread returns and the message is processed by the SEDA thread pool. Nothing gets returned from the result of the call.  The Mule service must have an asynchronous inbound endpoint.  If an error occurs it is handled by the Mule server.  One-Way return types are NullPayloads
  • 6. Messaging styles - contd Request – Response  Receives a message and the component returns a message.  If the component call returns null, then a Mule Message with a NullPayload is returned.  If the call method is void the request message is returned.  The Mule service must have a synchronous inbound endpoint and no outbound endpoint configured.
  • 7. Messaging styles - contd 6 Synchronous  A message is now processed synchronously if one of the following is true:  endpoint is request-response  A transaction is active  The message property MULE_FORCE_SYNC is set to TRUE  Receives a message and the component processes before sending it out on another endpoint. The request happens in the same thread.  Mule blocks on the outbound endpoint to wait for a response from the remote application (if applicable) until the responseTimeout threshold is reached. If no response is received, it returns null.  A synchronous call always returns a result, even if there is an outbound endpoint.
  • 8. 7 Messaging styles - contd Async Request Response  This pattern allows the back-end process to be forked to invoke other services and return a result based on the results of multiple service invocations.  The Async Reply Router is used to listen on a Reply To endpoint for results.  Set the reply-to address on the outbound router, and set the <async-reply> element to listen on that reply endpoint.
  • 9. Message scope Inbound  Inbound properties scope will hold the headers/properties sent by the caller flow/service/external source.  When a message arrives to a mule endpoint it can contain headers/properties. Those properties will be placed as inbound properties of the mule message.  Inbound message properties are read only.
  • 10. Outbound  Outbound properties scope will contain all the properties that will be deliver together with the message payload when calling an outbound endpoint.  When a message is deliver to another endpoint then all the properties in outbound scope will be sent together with the message as headers.  After calling an outbound endpoint that returns a response outbound properties are lost. Message scope - contd
  • 11. Message scope - contd  Invocation  An Invocation property will be present in the invoked flow and will last for all the flow execution.  Invocation properties are not propagated to other flows, but will be propagated if another flow or sub-flow is called using flow-ref.  Session  Mule session scope is created when a message enters a mule flow/service and it will preserved until the message leaves mule.  Mule session propagation is done only when mule endpoints transport supports message headers (i.e. JMS, HTTP, VM).  Any change to those properties within the async flow will not be reflected in the caller flow.  Application  Application properties scope is tied to the application lifecycle  Application properties are read only.
  • 12. Sample Code – Inbound Scope
  • 13. Sample Code – Outbound Scope
  • 14. Sample Code – Invocation Scope