-
Notifications
You must be signed in to change notification settings - Fork 82
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
【腾讯犀牛鸟计划】分别使用tRPC-Cpp的三种序列化方式完成对tRPC服务的调用 #136
Labels
Comments
vitlais001
pushed a commit
to vitlais001/trpc-cpp
that referenced
this issue
Jul 4, 2024
vitlais001
pushed a commit
to vitlais001/trpc-cpp
that referenced
this issue
Jul 4, 2024
vitlais001
pushed a commit
to vitlais001/trpc-cpp
that referenced
this issue
Jul 4, 2024
vitlais001
added a commit
to vitlais001/trpc-cpp
that referenced
this issue
Jul 5, 2024
vitlais001
added a commit
to vitlais001/trpc-cpp
that referenced
this issue
Jul 5, 2024
vitlais001
added a commit
to vitlais001/trpc-cpp
that referenced
this issue
Jul 5, 2024
vitlais001
added a commit
to vitlais001/trpc-cpp
that referenced
this issue
Jul 5, 2024
…group#136) tRPC-Cpp's three serialization methods for service calls (trpc-group#136) fix str resolve the corresponding issue trpc-group#136
文档: https://github.com/Vitalis001/trpc-cpp/blob/main/docs/zh/trpc_protobuf_json_noop_guide.md代码仓库: https://github.com/Vitalis001/trpc-cpp编译运行:protobuf:编译整个示例代码
运行服务端程序
打开另外一个终端,运行客户端测试程序。
将看到如下输出
使用
json编译示例代码
运行服务端程序
运行客户端程序
将看到如下输出
noop编译示例代码
运行服务端程序
运行客户端程序
将看到如下输出
|
另外,这个issue对于noop的功能,更愿意看到noop数据格式由你自己组织/解析,而不是复用json(因为已经有了json传输的能力) |
大部分体验功能点验证ok,关闭此issue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
issue介绍
tRPC-Cpp提供了多种消息(反)序列化方式,以应对业务丰富多样的场景,比如http通常用json来交互,rpc通常用protobuf来交互,你甚至可以自定义一种消息的序列化反序列化格式用noop,然后自己做序列化/反序列化。
你需要使用不同的(反)序列化方法,完成对tRPC服务的调用,并用腾讯文档输出一份报告到issue回复里,报告需要包含你的实践过程(关键的代码以及日志输出等)以及你的心得体会,最后提交相关变更代码到你个人的repo以及编译运行指引到issue回复里,方便我们测试验证你的确完成了issue。
具体地,你可以按下面的步骤完成此issue
1、交互的消息可以按json格式来表达:
{ name: "issueshooter", age: 18, hobby: ["opensource project","movies", "books"] }
2、改写examples/helloworld的proto文件及相应代码,让其传递1中的信息
3、改写examples/features/trpc_json传递的json内容,让其传递1中的信息
4、改写examples/features/trpc_noop传递的内容,你可以按自己的想法,合理地设计一套规则,在客户端将1拼接成一个字符串,在服务端从这个字符串解出信息
参考资料
其他说明
本issue为2024犀牛鸟开源人才培养活动专属issue,仅供在校大学生参与领取
【认领issue】在研学基地"issue营地"对应issue行的M~R列抢滩报名,即视为认领成功。
【完成issue】已认领issue的同学,请同步在本issue评论区回复“已成功领取本issue”; 如7天内无提交任何进展包括不限于comment \ commit \ Pull Request,则将视为同学主动放弃issue,组委会将释放issue给下一位等候者。
The text was updated successfully, but these errors were encountered: