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

[3.0]Add gRPC extensibility #5013

Closed
wants to merge 15 commits into from
Closed

Conversation

kids-return
Copy link
Contributor

No description provided.

@kids-return kids-return reopened this Aug 19, 2022
@kids-return
Copy link
Contributor Author

这个等我再完善一下异常处理
#5036

@huangdijia
Copy link
Member

get/post ??官方的BaseStub没看到有这个🤣

@kids-return
Copy link
Contributor Author

kids-return commented Aug 19, 2022

hyperf 的路由是支持的,我晚点再验证一下,查一下文档

@huangdijia
Copy link
Member

hyperf路由支持也得兼容官方GRPC吧

@kids-return
Copy link
Contributor Author

这一块我还要确认验证一下,如果只支持 POST 的话,hyperf gRPC 路由那里最好要限制一下,以免产生歧义
我明天研究一下 go 相关的

@kids-return
Copy link
Contributor Author

如果gRPC 官方只支持 POST 的话只调用 POST 即可。如果 Hyperf Server 定义了 GET 使用 POST 调用将会找不到方法

@kids-return
Copy link
Contributor Author

等我确认一下吧,如果只支持 POST 的话建议 Server 和 Client 都进行限制

@kids-return
Copy link
Contributor Author

https://chromium.googlesource.com/external/github.com/grpc/grpc/+/HEAD/doc/PROTOCOL-HTTP2.md
查到了这个,确实只支持 POST, 我认为应该对 Server 做限制
目前的 Server 支持除 POST 外的其他方法,也支持多级的路径 例如 /service/method1/method/2
我之后尝试按上面的文档调整

@kids-return
Copy link
Contributor Author

https://github.com/aspnet/AspLabs/blob/12d388c1964c8844dcbbdcd643f8bd7c6423a4c4/src/GrpcHttpApi/sample/Proto/greet.proto

无意间看到这个,使用 http 调用 gRPC,备注一下 与本 PR 无关

@kids-return
Copy link
Contributor Author

kids-return commented Aug 19, 2022

Hyperf Server 使用 Router::grpc 定义方法如何,其他的方法忽略 只能通过 这个方法定义 grpc 服务
这个方法的 路径也强制使用协议上的格式

@PandaLIU-1111
Copy link
Member

Hyperf Server 使用 Router::grpc 定义方法如何,其他的方法忽略 只能通过 这个方法定义 grpc 服务 这个方法的 路径也强制使用协议上的格式

我也比较倾向于这种做法

@kids-return
Copy link
Contributor Author

@limingxinleo
Copy link
Member

rebase到master

@kids-return
Copy link
Contributor Author

#5047 用这个吧,基于 master 分支的

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.

None yet

4 participants