gogf / gf

GoFrame is a modular, powerful, high-performance and enterprise-class application development framework of Golang.
https://goframe.org
MIT License
11.77k stars 1.6k forks source link

Make a suggestion and hope it can be improved and a GRPC problem #3159

Closed ethantx closed 1 week ago

ethantx commented 1 year ago

需要改进 一、全局的注册服务发现功能,希望改成按需加载。 二、GRPC服务端建议加个超时管理,客户端连过来超过N秒后就断开。这方面gozero处理得非常好 三、GRPC客户端首次链接时不会抛出error异常。这个应该需要抛出来才行

Issues-translate-bot commented 1 year ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


First of all, grpc under the microservice module will not throw an error when the first connection fails. This should throw an error if the first link fails. Convenient to troubleshoot problems. What needs improvement is the service registration discovery function. This is now used globally. It is unreasonable to use it directly whether it is an api service or a client requesting the client. I hope that this can be separated and used where needed, instead of using all services as soon as they are turned on. It is easy to cause trouble to people.

gqcn commented 1 month ago

@ethantx 不好意思,我来晚了,由于邮件丢失我错过了一些issue的消息提示。感谢你的反馈和建议,我一一回复一下:

一、全局的注册服务发现功能,希望改成按需加载。 关于第一点,能否详细描述一下痛点?

二、GRPC服务端建议加个超时管理,客户端连过来超过N秒后就断开。这方面gozero处理得非常好 关于第二点,这块和 https://github.com/gogf/gf/issues/3189 重复,希望大家一起来共建这块中间件。

三、GRPC客户端首次链接时不会抛出error异常。这个应该需要抛出来才行 关于第三点,我看创建GRPC客户端时如果存在错误都会返回,这块能否也详细描述一下?

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@ethantx Sorry, I'm late. I missed some issue messages due to lost emails. Thank you for your feedback and suggestions, I will reply to them one by one:

  1. The global registration service discovery function is expected to be changed to on-demand loading. Regarding the first point, can you describe the pain points in detail?

  2. It is recommended to add a timeout management to the GRPC server. The client will be disconnected after more than N seconds. gozero handled this very well Regarding the second point, this is the same as https://github.com/gogf/gf/issues/3189. I hope everyone can work together to build this middleware.

  3. The GRPC client will not throw an error exception when connecting for the first time. This should need to be thrown out Regarding the third point, I think if there is an error when creating the GRPC client, it will be returned. Can you describe this in detail?