Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: add grpc_multi_service client #95

Merged
merged 2 commits into from
Jan 6, 2024

Conversation

ViolaPioggia
Copy link
Member

What type of PR is this?

feat

Check the PR title.

feat: add grpc_multi_service client

@ViolaPioggia ViolaPioggia requested review from a team as code owners January 6, 2024 12:35
felix021
felix021 previously approved these changes Jan 6, 2024
AsterDY
AsterDY previously approved these changes Jan 6, 2024
@ViolaPioggia ViolaPioggia dismissed stale reviews from AsterDY and felix021 via f989336 January 6, 2024 13:53
@li-jin-gou li-jin-gou merged commit f62489d into cloudwego:main Jan 6, 2024
4 checks passed
@ViolaPioggia ViolaPioggia deleted the grpc_multi_service branch January 7, 2024 06:54
3. 修改 main.go
```
func main() {
clienta := servicea.MustNewClient("servicea", client.WithHostPorts("127.0.0.1:8888"))
Copy link
Member

Choose a reason for hiding this comment

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

可能所有client都需要指定client.WithTransportProtocol(transport.GRPC),我不确定(我后面提了个 issue 没再查了)。
我有一个multiservice s0
当服务s1使用了c1,c2指定了transport访问s0是成功的。
但后来发现别的服务s2只使用c1并不需要c2时,不指定transport访问仍然报找不到method

Copy link
Member Author

Choose a reason for hiding this comment

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

代码能够正常运行,这里的 clienta 是不需要指定 client.WithTransportProtocol(transport.GRPC) 的,当然指定了也不会有问题;如果想要实现 multiservice ,后续的 clientb 是需要指定 client.WithTransportProtocol(transport.GRPC) 的,否则就会如你所说出现找不到 method 的情况,后续我补充一下 README 吧

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants