-
Notifications
You must be signed in to change notification settings - Fork 63
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
Supports grpc+json and the curl tool #148
Conversation
将json消息转化为grpc消息,继而交给grpc handle进行处理,并以json格式返回数据
Optimized the logic of TripleServer and TripleClient, achieving code reuse. Merged encoding and encoding_json
dubbo/src/triple/server/triple.rs
Outdated
pub struct TripleServer<T> { | ||
codec: T, | ||
pub struct TripleServer<T, V> { | ||
_pd: PhantomData<(T, V)>, |
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.
将TripleServer中 T, V 这两个泛型 改成 M1, M2,和TripleClient保持一致。注意区分哪个是request和response
dubbo/src/triple/client/triple.rs
Outdated
{ | ||
let config = | ||
ConsumerConfig::get_global_consumer_config(invocation.get_target_service_unique_name()); |
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.
这种实现方式有些不太好:配置逻辑侵入到核心代码中,并且这是一段隐藏逻辑。
根据service_name来动态地从配置文件中获取codec、compress 这个功能可以先去掉。这个功能应该在一个单独的feature里来做。
我建议:这个pr可以先支持基于ClientBuilder的静态配置的方式。将codec和compress配置项加在ClientBuilder里。另外,可以通过加载配置文件来初始化ClientBuilder,进而初始化TripleClient。
dubbo-build/src/server.rs
Outdated
@@ -330,7 +328,7 @@ fn generate_unary<T: Method>( | |||
method_ident: Ident, | |||
server_trait: Ident, | |||
) -> TokenStream { | |||
let codec_name = syn::parse_str::<syn::Path>(CODEC_PATH).unwrap(); | |||
// let codec_name = syn::parse_str::<syn::Path>(CODEC_PATH).unwrap(); |
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.
删除注释掉的代码
… loading method.(#145)
The RPC client now exclusively uses protobuf for serialization.
Good work. Thanks for your contribution to dubbo-rust. |
Implemented support for grpc+Json, and enabled direct communication between curl tool and unary services