Rust implementation #7
Replies: 15 comments 20 replies
-
|
Not a rust expert, just want to share some thoughts. |
Beta Was this translation helpful? Give feedback.
-
|
Do you kind people know https://github.com/AThilenius/axum-connect? |
Beta Was this translation helpful? Give feedback.
-
|
I saw the news about Buf Rust SDK, is Rust backend coming? |
Beta Was this translation helpful? Give feedback.
-
|
Additionally, axum-connect hasn't received a single update in 7 months so it doesn't seem like a viable solution. |
Beta Was this translation helpful? Give feedback.
-
|
There is another implementation https://github.com/lann/connect-rpc-rs |
Beta Was this translation helpful? Give feedback.
-
|
Hey @akshayjshah I wonder if you could share some update about the discussion. |
Beta Was this translation helpful? Give feedback.
-
|
@akshayjshah What are your thoughts on this grpc-io official move to support rust? |
Beta Was this translation helpful? Give feedback.
-
|
Any news about grpc-rust? Something we can try? |
Beta Was this translation helpful? Give feedback.
-
|
Hello everyone. I introduce my axum-connect plugin for protoc. Let's check out here https://github.com/yaroher/protoc-gen-axum-connect. Welcome to report issues and and give stars) |
Beta Was this translation helpful? Give feedback.
-
|
I have tested connectrpc-axum, confirmed support for pure Connect (proto), and successfully migrated an existing Go Connect service to it |
Beta Was this translation helpful? Give feedback.
-
|
I didn't post the repo here earlier because it is still in early stages: connectrpc-axum. In the Rust ecosystem, web frameworks generally follow two styles: Axum-style, based on the implementation, we got:
Go-idiomatic style: tonic I chose the Axum api style and similar implementation for this crate. This allows you to leverage the full Axum ecosystem, enabling a gradual migration from a standard Axum HTTP app to a hybrid HTTP and Connect app. Compare to axum-connect, my goal was to maintain native compatibility with the existing Axum ecosystem.
The repo currently relies on prost, axum, and tonic. As a next step, maybe moving to the official protoc rust generator. |
Beta Was this translation helpful? Give feedback.
-
|
For anyone else curious about how https://github.com/washanhanzi/connectrpc-axum stacks up against https://github.com/AThilenius/axum-connect, I let Opus wild on a review run, this is what it came up with Deep Comparison: connectrpc-axum vs axum-connect
Feature Comparison
Why the 10x Size Difference?
Code Quality Comparison // Extensive error handling with fallback responses
pub(crate) fn internal_error_response(content_type: &'static str) -> Response
pub(crate) fn internal_error_end_stream_frame() -> Vec<u8>
// Full protocol detection
pub enum RequestProtocol {
ConnectUnaryJson,
ConnectUnaryProto,
ConnectStreamJson,
ConnectStreamProto,
Unknown,
}// Middleware layer stack with proper Tower integration axum-connect: // Clean but minimal - many TODOs
// From handler_unary.rs:28-33
// TODO: protocol version validation
// TODO: timeout handling
// TODO: metadata parsing
// From lib.rs - acknowledged hack
// TODO: This is a nasty hack. Get rid of it.
let files = Rc::new(RefCell::new(vec![]));API Ergonomics axum-connect: let app = Router::new()
.rpc(HelloWorldService::say_hello(say_hello_handler))
.rpc(HelloWorldService::say_hello_stream(stream_handler));connectrpc-axum: let router = HelloWorldServiceBuilder::new()
.say_hello(say_hello)
.build_connect(); // or .build_tonic() for gRPC supportMy Assessment
Recommendation
|
Beta Was this translation helpful? Give feedback.
-
|
connectrpc-axum has been updated to |
Beta Was this translation helpful? Give feedback.
-
|
Came across this by Anthropic: https://github.com/anthropics/connect-rust. I haven’t tried it yet, but based on the docs, it looks promising. |
Beta Was this translation helpful? Give feedback.
-
|
Hi folks, as @sagsfaller0e points out we released a fully conformant protobuf and ConnectRPC implementation last week:
An RFC is up to consider promoting this to the official ConnectRPC implementation for Rust. Performance is very competitive with tonic, prost, and Google's beta upb-wrapping protobuf implementation. It's a 0.x release for the time being while I work out some ergonomics kinks and do further profiling-guided performance optimizations. I'll be publishing a road map for additional features in the next week or so. We're already using this implementation in production at Anthropic - I hope y'all are willing to give it a shot, and open issues for anything you find, no matter how small! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Would you or your company use a Connect implementation in Rust? If yes, please leave a comment and tell us more about what you'd like (especially if you need integration with a particular framework).
357 votes ·
Beta Was this translation helpful? Give feedback.
All reactions