2.mule Message Stucture

You might also like

Download as odt, pdf, or txt
Download as odt, pdf, or txt
You are on page 1of 3

Mule Message Structure

Mule4:

==>Mule message is a Java Object.


==>Mule message is a data that passes through an application via one or more flows.
=> It consists of 2 main parts,
• The message header, which contains metadata about the message.

• The message payload, which contains your business-specific data.

=>Mule message is itself embedded in a mule object. Some mule message objects may contain attachments,
variables & exception payloads.

Inbound Properties:

=>These are immutable


=>These are automatically generated by message source when it hit mule ESB.
=>These can't be set or manipulated by the user.
=>They contain metadata specific to message source.
=>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.

Outbound Properties::
=>These are Mutable, developer has to set these properties.
=>these are set during the course of the flow.
=>these can become inbound properties when message passes from out bound endpoint of one flow to inbound
end point of another flow.
=> By using Property Transformer we can set outbound properties.

Variables::
=>Variables are user defined metadata about the message.
These are used to create & retrieve information.
=>Variables have 3 scopes
• Flow variables - apply only to the flow in which they exist.
◦ Set by using Variable component.
▪ Attributes:
• Set Variable – expects Name & Value
• Remove Variable
◦ You can call flow variable by using - #[flowVars.name]
◦ Accessible to sub flow

• Session Variables – available across all flows with in the same project/application.
◦ Session variables are stored in app.registry
◦ Session Variables doesn’t pass through HTTP connectors, these can be passed to other flow or sub
flow through Flow Ref & VM Connector.
◦ By Using Session Variable Component we can set the Session Variables
▪ Attributes
• Set Variable
• Remove Variable
◦ Called by using #[SessionVars.name]

• Record variables – apply only to the records processed as a part of a batch. i.e apply only to batch
processed records.

Payload::
=>Message payload is the most important part of mule message, because it contains data that your mule
application/project processes.

Attachments::
=>To send any attachments with the mule message.
=> You can attach any files to the mule message by using setAttachment property of Attachment
transformer.

Exception Payload::
=>which is set when an exception arises in the mule flow.

You might also like