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

Commit

Permalink
Event changes (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
slinkydeveloper authored Oct 16, 2023
1 parent 65c768d commit b944dcb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 27 deletions.
29 changes: 2 additions & 27 deletions dev/restate/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string> attributes = 15;
}

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

// Metadata
string source = 3;
map<string, string> 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<string, string> attributes = 15;
}
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 b944dcb

Please sign in to comment.