Skip to content

Commit

Permalink
Merge commit '359c91bba5842fa55f56660e7849ac03007b12e4'
Browse files Browse the repository at this point in the history
  • Loading branch information
slinkydeveloper committed Oct 16, 2023
2 parents 0058656 + 359c91b commit 57b062a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 27 deletions.
29 changes: 2 additions & 27 deletions sdk-core/src/main/proto/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 sdk-core/src/main/proto/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 57b062a

Please sign in to comment.