Skip to content

WIP: ingestion API protocol#5024

Draft
muhamadazmy wants to merge 1 commit into
mainfrom
pr5024
Draft

WIP: ingestion API protocol#5024
muhamadazmy wants to merge 1 commit into
mainfrom
pr5024

Conversation

@muhamadazmy

@muhamadazmy muhamadazmy commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary:
A seed for the ingestion protocol protobuf.


Stack created with Sapling. Best reviewed with ReviewStack.

@muhamadazmy

Copy link
Copy Markdown
Contributor Author

We are not committing to gRPC. This is only the protocol definition. Right now I am investigating ConnectRPC which seems promising so far.

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

Test Results

  8 files  ±0    8 suites  ±0   4m 55s ⏱️ -15s
 61 tests ±0   61 ✅ ±0  0 💤 ±0  0 ❌ ±0 
268 runs  ±0  268 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit c981d72. ± Comparison against base commit 7f29523.

♻️ This comment has been updated with latest results.

// optional fields
optional string scope = 2;
optional string limit_key = 3;
optional string service = 4;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

service key as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's invocation specific

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't hurt to have it here imo, and it's free anyway. i can see a use case where you wanna send records to always the same key

optional string limit_key = 3;
optional string service = 4;
optional string handler = 5;
map<string, string> headers = 6;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do these sum with the Overrides? or Overrides replace them all?

I think it makes sense they sum.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it merges with the defaults. So it doesn't replace them all. Only the set values

optional string handler = 4;
// These headers are merged with the default headers
// from the Settings message.
map<string, string> headers = 5;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then maybe give it a name like additional_headers -> indicating it adds to the headers in settings.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, will do

// Required when the target service is a virtual object (VO).
optional string key = 2;
optional string tracing_parent = 3;
optional Overrides overrides = 4;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we inline these? it's more efficient.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure thing, it just felt cleaner to group them. No strong opinion

uint64 offset = 1;
// Required when the target service is a virtual object (VO).
optional string key = 2;
optional string tracing_parent = 3;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

w3c-tracecontext format right? in that case, just give it that name.

ErrorKind_UNKNOWN = 0;
// Server is shutting down and
// can't accept more records
SHUTTING_DOWN = 1;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unclear what am i supposed to do in this case.

Comment on lines +79 to +82
message Error {
ErrorKind kind = 1;
string message = 2;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the errors related to schema registry and co, how about we return an InvocationError in same format we use in ingress? (404 for not found, idr what error code for provided limit key without scope, etc etc).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This way error handling can be unified among regular ingress usage and the ingress ingestion api

Summary:
A seed for the ingestion protocol protobuf.

syntax = "proto3";

package restate.ingestion;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
package restate.ingestion;
package dev.restate.ingress.ingestion;

// optional fields
optional string scope = 2;
optional string limit_key = 3;
optional string service = 4;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't hurt to have it here imo, and it's free anyway. i can see a use case where you wanna send records to always the same key

Comment on lines +46 to +47
optional string traceparent = 3;
optional string tracestate = 4;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these in format w3c tracecontext? if yes, can you please add it as comment?

message Record {
uint64 offset = 1;
// Required when the target service is a virtual object (VO).
optional string key = 2;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or workflow

// from the Settings message.
map<string, string> additional_headers = 9;

bytes payload = 100;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

up to 15 included you use one byte for the field varint, for a field that we're gonna always set use field numbers 1 -> 15 pls

// (think Kafka cluster + topic + partition).
// An explicitly empty producer ID is valid but disables
// deduplication for the entire stream.
string producer_id = 1;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the protocol stands, i can in theory change this value during the stream, sending another settings with a different producer_id, is it a good idea to allow this?

Comment on lines +90 to +93
message Error {
ErrorKind kind = 1;
string message = 2;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A related question here, what is the expectation for a client when receiving this Error message? that the server will afterwards tear down the stream?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants