From 359c91bba5842fa55f56660e7849ac03007b12e4 Mon Sep 17 00:00:00 2001 From: slinkydeveloper Date: Mon, 16 Oct 2023 13:40:04 +0200 Subject: [PATCH] Squashed 'sdk-core/src/main/proto/' changes from 65c768d..b944dcb b944dcb Event changes (#30) git-subtree-dir: sdk-core/src/main/proto git-subtree-split: b944dcb57837b0bd62cb6c0b53a560bbd6a85c4e --- dev/restate/events.proto | 29 ++--------------------------- dev/restate/ext.proto | 7 +++++++ 2 files changed, 9 insertions(+), 27 deletions(-) diff --git a/dev/restate/events.proto b/dev/restate/events.proto index 491d903b..e69fcf96 100644 --- a/dev/restate/events.proto +++ b/dev/restate/events.proto @@ -12,41 +12,16 @@ syntax = "proto3"; package dev.restate; import "dev/restate/ext.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/struct.proto"; option java_multiple_files = true; option java_package = "dev.restate.generated"; option go_package = "restate.dev/sdk-go/pb"; message Event { - // Payload - bytes payload = 2; - - // Metadata - string source = 3; - - // This is filled by the source to retain ordering guarantees, depending on the source type bytes ordering_key = 1 [(dev.restate.ext.field) = KEY]; - map attributes = 15; -} - -message KeyedEvent { - // Payload - bytes key = 1 [(dev.restate.ext.field) = KEY]; - bytes payload = 2; - - // Metadata - string source = 3; - map attributes = 15; -} -message StringKeyedEvent { - // Payload - string key = 1 [(dev.restate.ext.field) = KEY]; - bytes payload = 2; + bytes key = 2; + bytes payload = 3; - // Metadata - string source = 3; map attributes = 15; } diff --git a/dev/restate/ext.proto b/dev/restate/ext.proto index d364eab1..ed358f72 100644 --- a/dev/restate/ext.proto +++ b/dev/restate/ext.proto @@ -30,6 +30,13 @@ enum ServiceType { enum FieldType { // protolint:disable:next ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH KEY = 0; + + // Flag a field as event payload. When receiving events, this field will be filled with the event payload. + // Note: only types string and bytes can be used for event payload fields + EVENT_PAYLOAD = 1; + // Flag a field as event metadata. When receiving events, this field will be filled with the event metadata. + // Note: only type map can be used for event payload fields + EVENT_METADATA = 2; } extend google.protobuf.ServiceOptions {