What is the payload in MuleSoft
The payload content changes as it travels through a flow when message processors in a Mule flow set it, enrich it, transform it into a new format, extract information from it, or even store it in a Mule event variable and produce a new payload. know more at Mulesoft online training
Mule 4 has simplified the Mule message model in which each Mule event has a message and variables associated with it. A Mule message is composed of a payload and its attributes (metadata information, such as file size).
A Mule event contains the core information processed by the runtime. Mule events are immutable, so every change to an instance of a Mule event results in the creation of a new instance.
A Mule Event is composed of these objects:
While we have already seen this in Mule 3, Mule message is, itself, embedded within a Mule message object and it may contain variables, attachments, and exception payloads.
You can check out more about Mule 3 Message Structure
In Mule 3, when the request is received by Mule message source, it is converted into a Mule message or flow and starts processing it when it receives an inbound endpoint in a flow. know more at Mulesoft training
In Mule 4, flows triggered by an event are generated when a trigger reaches the event source of the flow. This trigger could be an external event triggered by a resource that might be external to the Mule app. The event source produces a Mule event. The Mule event travels sequentially through the components of a flow.
Each component interacts in a pre-defined manner with the Mule event.
Variables
It may be defined as the user-defined metadata about a message. Basically, variables are temporary pieces of information about a message used by the application that is processing it. It is not meant to be passed along with the messages to its destination. know more at Mulesoft online course They are of three types as given below −
Flow variables − These variables apply only to the flow in which they exist.
Session variables − These variables apply across all the flows within the same application.
Record variables − These variables apply only to records processed as part of a batch.
Attachments and Extra Payload
These are some extra metadata about message payload which is not necessarily appeared every time in message object.