-
Notifications
You must be signed in to change notification settings - Fork 183
wip-poc: connect-rpc scafolding #5026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
muhamadazmy
wants to merge
2
commits into
main
Choose a base branch
from
pr5026
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| // Copyright (c) 2023 - 2026 Restate Software, Inc., Restate GmbH. | ||
| // All rights reserved. | ||
| // | ||
| // Use of this software is governed by the Business Source License | ||
| // included in the LICENSE file. | ||
| // | ||
| // As of the Change Date specified in that file, in accordance with | ||
| // the Business Source License, use of this software will be governed | ||
| // by the Apache License, Version 2.0. | ||
|
|
||
| fn main() { | ||
| println!("cargo:rerun-if-changed=protobuf/ingestion_svc.proto"); | ||
|
|
||
| // Only generate (and thus require the `connectrpc` runtime + protoc) when the | ||
| // `ingestion` feature is enabled. Build scripts cannot use `cfg(feature = ...)`, | ||
| // so we gate on the env var Cargo sets for the feature instead. | ||
| connectrpc_build::Config::new() | ||
| .files(&["protobuf/ingestion_svc.proto"]) | ||
| .includes(&["protobuf/"]) | ||
| .include_file("_connectrpc.rs") | ||
| .compile() | ||
| .expect("failed to compile protobuf/ingestion_svc.proto"); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| // Copyright (c) 2026 - Restate Software, Inc., Restate GmbH | ||
| // | ||
| // This file is part of the Restate service protocol, which is | ||
| // released under the MIT license. | ||
| // | ||
| // You can find a copy of the license in file LICENSE in the root | ||
| // directory of this repository or package, or at | ||
| // https://github.com/restatedev/proto/blob/main/LICENSE | ||
|
|
||
| syntax = "proto3"; | ||
|
|
||
| package restate.ingestion; | ||
|
|
||
|
|
||
| // A Settings message defines the default values applied to all | ||
| // subsequent records in the stream. | ||
| // Each Settings message must specify every field it wants to set: | ||
| // its fields are not merged with those of previous Settings messages. | ||
| // Leaving an optional field unset clears any previously established | ||
| // default, so later records must supply the value explicitly if needed. | ||
| message Settings { | ||
| // required fields | ||
|
|
||
| // Unique producer ID for the stream. Deduplication relies on this | ||
| // ID being unique per ingestion stream | ||
| // (think Kafka cluster + topic + partition). | ||
| // An explicitly empty producer ID is valid but disables | ||
| // deduplication for the entire stream. | ||
| string producer_id = 1; | ||
|
|
||
| // optional fields | ||
| optional string scope = 2; | ||
| optional string limit_key = 3; | ||
| optional string service = 4; | ||
| optional string handler = 5; | ||
| map<string, string> headers = 6; | ||
| } | ||
|
|
||
| message Overrides { | ||
| } | ||
|
|
||
| message Record { | ||
| uint64 offset = 1; | ||
| // Required when the target service is a virtual object (VO). | ||
| optional string key = 2; | ||
| optional string traceparent = 3; | ||
| optional string tracestate = 4; | ||
|
|
||
| // Overrides | ||
| optional string scope = 5; | ||
| optional string limit_key = 6; | ||
| optional string service = 7; | ||
| optional string handler = 8; | ||
| // These headers are merged with the default headers | ||
| // from the Settings message. | ||
| map<string, string> additional_headers = 9; | ||
|
|
||
| bytes payload = 100; | ||
| } | ||
|
|
||
| message Request { | ||
| oneof payload { | ||
| Settings settings = 1; | ||
| Record record = 2; | ||
| } | ||
| } | ||
|
|
||
| // Application-layer flow control message. | ||
| // It tells the client how much more it can send | ||
| // before it must wait for the next window update. | ||
| // | ||
| // WindowUpdate also doubles as an explicit ack: the | ||
| // server can send an update with a 0 increment to | ||
| // acknowledge commits up to "Response::last_committed" | ||
| // without changing the window size. | ||
| message WindowUpdate { | ||
| uint64 increment = 1; | ||
| } | ||
|
|
||
| enum ErrorKind { | ||
| ERROR_KIND_UNKNOWN = 0; | ||
| // Server is shutting down and | ||
| // can't accept more records | ||
| ERROR_KIND_SHUTTING_DOWN = 1; | ||
| ERROR_KIND_UNKNOWN_SERVICE = 2; | ||
| ERROR_KIND_UNKNOWN_HANDLER = 3; | ||
| // add new error kinds here | ||
|
|
||
| } | ||
| message Error { | ||
| ErrorKind kind = 1; | ||
| string message = 2; | ||
| } | ||
|
|
||
| message Response { | ||
| // Offsets are 0-based, so last_committed must be optional | ||
| // to distinguish "offset 0 committed" from "nothing committed yet". | ||
| // This matters when an error is returned on the first | ||
| // ingestion message. | ||
| optional uint64 last_committed = 1; | ||
|
|
||
| oneof response { | ||
| WindowUpdate ack = 2; | ||
| Error error = 3; | ||
| } | ||
| } | ||
|
|
||
| // Service that is only reachable on nodes that are alive. | ||
| service IngestionSvc { | ||
| // Opens a bidirectional node-to-node stream. | ||
| rpc Ingest(stream Request) | ||
| returns (stream Response); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please tell me that we are not going to pull prost+buffa+bilrost+flexbuffers in the same project :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, don't worry. I am trying few things including tonic/prost. Was experimenting with connect protocol since it can also use http1 for streaming.
If u have time to review u should take a look at the other pr that defines the protobuf schema.