Skip to main content

Cloud Event

Overview

CloudEvent is a wrapper format used throughout the OpenDSO platform for exchanging data between services via NATS messaging. Almost all DTOs in OpenDSO are wrapped in CloudEvent structures when transmitted over the message bus or returned from API calls. This standardized envelope provides consistent metadata about the message including its source, type, timestamp, and content type.

The data field of the CloudEvent contains the actual payload, which can be any DTO type (CIMEX equipment data, rule parameters, service responses, etc.). This wrapper pattern enables OpenDSO services to handle messages uniformly while supporting diverse payload types.

For example, the Event Service API returns CloudEvent DTOs with RuleEvent data:

CloudEvent DTO
data: Array(RuleEvent)

CloudEvent wrappers are used by all OpenDSO service APIs:

Cloud Event

FieldTypeLabelDescription
idstringgetUUID()
sourcestring
specversionstring"1.0"
typestring
datacontenttypeOptional<std::string>
subjectOptional<std::string>
timestampOptional<std::string>getTimestamp()
datageneric(T)