Skip to content
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

Implement service discovery #103

Merged
merged 4 commits into from
Feb 9, 2023
Merged

Conversation

robberphex
Copy link
Collaborator

@robberphex robberphex commented Jan 19, 2023

  1. Connect to a host:
    let builder = ClientBuilder::from_static(&"http://127.0.0.1:8888").with_timeout(1000000);
    let mut cli = EchoClient::new(builder);
  2. Or use customized directory:
    let builder = ClientBuilder::new();
    builder=builder.with_directory(customized_directory);
    let mut cli = GreeterClient::new(builder);

@robberphex robberphex force-pushed the service_discovery branch 2 times, most recently from f6ccea7 to fc8be9f Compare January 19, 2023 09:57
@robberphex robberphex force-pushed the service_discovery branch 2 times, most recently from a657e92 to f66be94 Compare January 19, 2023 10:07
@@ -189,3 +189,35 @@ impl Metadata {
header
}
}

Copy link
Member

Choose a reason for hiding this comment

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

implementation of RpcInvocation is too complicated. Now we can use a struct as metadata. In future, we can rebuild this struct by new requirements

@@ -83,6 +92,14 @@ impl<T> TripleClient<T> {
self.builder.unwrap(),
)
}

Copy link
Member

Choose a reason for hiding this comment

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

Dubbo的一个特性是配置优先。我建议可以将服务发现相关的配置放到clientBuilder中,通过配置来启动服务发现;这样可以简化dubbo-build侧client生成的代码
另外,自定义配置directory应该是高级能力。

@robberphex robberphex force-pushed the service_discovery branch 2 times, most recently from 6d49aff to 186c176 Compare February 8, 2023 17:05
@robberphex robberphex changed the title implement service discovery Implement service discovery Feb 9, 2023
Comment on lines +81 to +85
// pub fn build(builder: ClientBuilder) -> Self {
// Self {
// inner: TripleClient::new(builder),
// }
// }
Copy link
Member

Choose a reason for hiding this comment

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

remove

@AlbumenJ AlbumenJ merged commit aeeb354 into apache:main Feb 9, 2023
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.

3 participants