Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions temporal/api/stream/v1/message.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
syntax = "proto3";

package temporal.api.stream.v1;

option go_package = "go.temporal.io/api/stream/v1;stream";
option java_package = "io.temporal.api.stream.v1";
option java_multiple_files = true;
option java_outer_classname = "MessageProto";
option ruby_package = "Temporalio::Api::Stream::V1";
option csharp_namespace = "Temporalio.Api.Stream.V1";

import "temporal/api/common/v1/message.proto";

// One entry in a stream. The record is the wire format: stores keep it
// serialized as is and readers in every language decode the same bytes.
message StreamRecord {
// The value the producer published, stored as sent. A stream provider
// writes and reads it as part of the record, so applying a payload codec
// to it is the provider's job.
temporal.api.common.v1.Payload body = 1;
// Producer-supplied provenance, stored as sent.
map<string, temporal.api.common.v1.Payload> metadata = 2;
// Producer-supplied grouping label, stored as sent.
string topic = 3;
// How to read this record. Unspecified is read as DATA.
StreamRecordKind kind = 4;
// Who wrote the record. Empty when the owning Workflow did.
string producer_id = 5;
// The producer's attempt. Readers treat a later attempt by the same
// producer as superseding what the earlier one wrote.
int64 attempt = 6;
// The producer's position within its attempt, zero when it does not number
// its records. Stored as sent; the server does not assign, validate or
// order by it, and the stream's own offsets are what order a read.
int64 sequence = 7;
}

// What a record means to a reader. Kept on the record itself so every store
// and every language reads it the same way without a private envelope.
enum StreamRecordKind {
// Read as DATA.
STREAM_RECORD_KIND_UNSPECIFIED = 0;
// A value the producer published; `body` carries it.
STREAM_RECORD_KIND_DATA = 1;
// The producer named by `producer_id` writes nothing more on `topic`.
// Says nothing about that producer's outcome and does not end the stream.
STREAM_RECORD_KIND_FINISH = 2;
}
Loading