A Mule event contains the core information processed by the runtime. It travels through components inside your Mule app following the configured application logic.
Note that the Mule event is 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:
- A Mule Message contains a message payload and its associated attributes.
- Variables are Mule event metadata that you use in your flow.
A Mule event is generated when a trigger (such as an HTTP request or a change to a database or file) reaches the Event source of a flow.
This trigger could be an external event triggered by a resource that might be external to the Mule app.
- A trigger reaches the event source.
- 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.
A Mule message is created as part of a Mule event when a Message source in a Mule flow triggers a flow to start, as when an HTTP listener receives a response or each time the Scheduler component triggers an execution of the flow.
For example:
When an HTTP listener in a Mule app receives a response, it creates a Mule event with a Mule message that contains the content of the response as its payload along with the metadata associated with that content, such as HTTP headers, as it attributes. Message processors in the flow (such as Core components, File read operations, or the HTTP request operations) can then retrieve, set, and process Mule message data that resides in the Mule event according to their configurations.
Comments