Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
Event changes
Browse files Browse the repository at this point in the history
  • Loading branch information
slinkydeveloper committed Oct 9, 2023
1 parent f4e659a commit 3456cb8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
27 changes: 11 additions & 16 deletions dev/restate/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,33 +20,28 @@ option java_package = "dev.restate.generated";
option go_package = "restate.dev/sdk-go/pb";

message Event {
// Payload
bytes payload = 2;
bytes ordering_key = 1 [(dev.restate.ext.field) = KEY];

// Metadata
string source = 3;
bytes key = 2;
bytes payload = 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<string, string> attributes = 15;
}

message KeyedEvent {
option deprecated = true;

// Payload
bytes key = 1 [(dev.restate.ext.field) = KEY];
bytes payload = 2;

// Metadata
string source = 3;
map<string, string> attributes = 15;
bytes payload = 2 [(dev.restate.ext.field) = EVENT_PAYLOAD];
map<string, string> attributes = 15 [(dev.restate.ext.field) = EVENT_METADATA];
}

message StringKeyedEvent {
option deprecated = true;

// Payload
string key = 1 [(dev.restate.ext.field) = KEY];
bytes payload = 2;

// Metadata
string source = 3;
map<string, string> attributes = 15;
bytes payload = 2 [(dev.restate.ext.field) = EVENT_PAYLOAD];
map<string, string> attributes = 15 [(dev.restate.ext.field) = EVENT_METADATA];
}
7 changes: 7 additions & 0 deletions dev/restate/ext.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string> can be used for event payload fields
EVENT_METADATA = 2;
}

extend google.protobuf.ServiceOptions {
Expand Down

0 comments on commit 3456cb8

Please sign in to comment.