Rust implementation #7
Replies: 15 comments 21 replies
|
Not a rust expert, just want to share some thoughts. |
|
Do you kind people know https://github.com/AThilenius/axum-connect? |
|
I saw the news about Buf Rust SDK, is Rust backend coming? |
|
Additionally, axum-connect hasn't received a single update in 7 months so it doesn't seem like a viable solution. |
|
There is another implementation https://github.com/lann/connect-rpc-rs |
|
Hey @akshayjshah I wonder if you could share some update about the discussion. |
|
@akshayjshah What are your thoughts on this grpc-io official move to support rust? |
|
Any news about grpc-rust? Something we can try? |
|
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) |
|
I have tested connectrpc-axum, confirmed support for pure Connect (proto), and successfully migrated an existing Go Connect service to it |
|
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. |
|
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
|
|
connectrpc-axum has been updated to |
|
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. |
|
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! Edit: this is now the official implementation of ConnectRPC for Rust: connectrpc/connectrpc.com#334 |
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).
382 votes ·
All reactions