Roles
Role elements are used for describing data feed from different streams with specific use cases.
A role does not require any parameters. The following roles are predefined for typical use cases:
Event
Most data streams assume Event role inside the platform, which is used throughout requests, saga steps and responses. If a stream is not assigned any specific role, it is treated as an Event stream. Event data has the following structure:
Request Metadata
This section of event data (requestMeta) contains information about the origin of a request (typically provided by the front-end systems) as well as its destination. It is only updated by the gateway.
Saga Metadata
This section of event data (sagaMeta) contains information required for orchestrating saga flows. Saga event handlers edit and use this section for recording the current step being processed during a saga, while allowing tracking of nested calls between saga flows. It is only updated by the runner orchestrating saga flow for an event.
Event Metadata
This section of event data (eventMeta) contains parameters for executing an action on a target event runner (such as inputElement, outputElement). Event runners rely on this information, along with the source stream an event is received from to perform required operations. It can be provided by a saga orchestrator, using event step details, and enriched by the runner receiving the event based on default metdata defined using stream, action or handler configurations.
Payload
This section of event data (payload) contains the actual body with user inputs which shall be processed and manipulated by runners. The input provided by end users / front-end systems are stored in "parameters" element of the payload, whereas runners receiving events are allowed to add or edit any part of this section.
Result
This section of event data (result) contains information about the results of last event runner's process (such as status and error details), which is typically used by the saga orchestrator in deciding whether to continue a saga flow or not.
Payload
Payload role type can be considered as a stripped down version of the Event roles, only including the payload section of event data. This role is typically used for consuming data feeds such as from Kafka topics, which are not in Event data format, but should be treated as such.
Since these records are missing metadata, their metadata should be created using override/default settings of their streams.
Pulse
Pulses are used for change data capture and include only identification details of a change (such as updated product's id).
Journal
Journals are also used for change data capture and include complete contents of a change (such as all updated fields of a product).
Debug
Debug role is used for directly logging data received from a stream. To display these logs, runner log level must be set to at least DEBUG.
A new role can be defined simply by creating a role alias inside a runner.
Last updated