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

后端服务是grpc的,hertz如何结合服务发现和grpc进行调用? #908

Closed
dobet opened this issue Aug 16, 2023 · 8 comments
Closed
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@dobet
Copy link

dobet commented Aug 16, 2023

Describe the Question

A clear and concise description of what the question is.

存量后端是用的grpc,如何在hertz中,使用注册中心+grpc进行调用?

Reproducible Code

Please construct a minimum complete and reproducible example for us to get the same error. And tell us how to reproduce it like how you send a request or send what request.

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your question.

Hertz version:

Please provide the version of Hertz you are using.

Environment:

The output of go env.

Additional context

Add any other context about the question here.

@chaoranz758
Copy link
Member

在 hertz 侧添加对应的注册中心服务发现客户端&&编写相应的pb文档并生成代码就可以用了吧

@dobet
Copy link
Author

dobet commented Aug 16, 2023

有对应的demo吗?我看现在使用注册中心的,都是client.Get或者client.Do这种直接发请求的

@li-jin-gou
Copy link
Member

在 hertz 侧添加对应的注册中心服务发现客户端&&编写相应的pb文档并生成代码就可以用了吧

调用 gprc 看看能不能还是用专业的 grpc client 吧,hertz client 没办法直接调用 grpc ,比如看看 kitex client https://www.cloudwego.io/zh/docs/kitex/tutorials/basic-feature/message_type/

@dobet
Copy link
Author

dobet commented Aug 16, 2023

在 hertz 侧添加对应的注册中心服务发现客户端&&编写相应的pb文档并生成代码就可以用了吧

调用 gprc 看看能不能还是用专业的 grpc client 吧,hertz client 没办法直接调用 grpc ,比如看看 kitex client https://www.cloudwego.io/zh/docs/kitex/tutorials/basic-feature/message_type/

期望是能够使用hertz本身的服务发现功能,然后结合grpc去做调用

@li-jin-gou
Copy link
Member

在 hertz 侧添加对应的注册中心服务发现客户端&&编写相应的pb文档并生成代码就可以用了吧

调用 gprc 看看能不能还是用专业的 grpc client 吧,hertz client 没办法直接调用 grpc ,比如看看 kitex client https://www.cloudwego.io/zh/docs/kitex/tutorials/basic-feature/message_type/

期望是能够使用hertz本身的服务发现功能,然后结合grpc去做调用

目前没办法直接支持,如果想支持需要 hertz 协议层和传输层适配 grpc。

@dobet
Copy link
Author

dobet commented Aug 16, 2023

在 hertz 侧添加对应的注册中心服务发现客户端&&编写相应的pb文档并生成代码就可以用了吧

调用 gprc 看看能不能还是用专业的 grpc client 吧,hertz client 没办法直接调用 grpc ,比如看看 kitex client https://www.cloudwego.io/zh/docs/kitex/tutorials/basic-feature/message_type/

期望是能够使用hertz本身的服务发现功能,然后结合grpc去做调用

目前没办法直接支持,如果想支持需要 hertz 协议层和传输层适配 grpc。

这块hertz有计划后面支持吗?

@li-jin-gou
Copy link
Member

在 hertz 侧添加对应的注册中心服务发现客户端&&编写相应的pb文档并生成代码就可以用了吧

调用 gprc 看看能不能还是用专业的 grpc client 吧,hertz client 没办法直接调用 grpc ,比如看看 kitex client https://www.cloudwego.io/zh/docs/kitex/tutorials/basic-feature/message_type/

期望是能够使用hertz本身的服务发现功能,然后结合grpc去做调用

目前没办法直接支持,如果想支持需要 hertz 协议层和传输层适配 grpc。

这块hertz有计划后面支持吗?

目前没人力支持这个feat,可以记到 todo 里

@li-jin-gou li-jin-gou added enhancement New feature or request help wanted Extra attention is needed labels Aug 16, 2023
@li-jin-gou
Copy link
Member

讨论了一下&不会支持,暂时关闭了。 grpc 相关可以使用 kitex 。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Development

No branches or pull requests

3 participants