baidu-std协议支持传输任意格式的数据
- Dominant language
- C++
- Stars
- 17.6k
- Forks
- 4.1k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 69
Description
**现状说明**
baidu-std协议目前支持[传输任意类型的request](https://github.com/apache/incubator-brpc/blob/master/src/brpc/protocol.cpp#L132),但是不支持解析任意类型的response,目前内部版本已经实现了baidu-std协议下支持传输任意类型的数据格式
**需求描述**
用户可以通过baidu-std协议传输任意格式的数据,比如:string,json等等,用户自己对数据进行打包和解包,rpc框架不需要关心
**实现方案**
- 新增SerializedResponse类(参考SerializedRequest)
- 在baidu-std协议ProcessRpcResponse函数中判断 cntl->response()->GetDescriptor() == SerializedResponse::descriptor()
Contributor guide
Research direction
Start in src/brpc/protocol.cpp around the existing arbitrary-request handling, then compare the proposed SerializedResponse class with SerializedRequest. Trace baidu-std's ProcessRpcResponse and the response descriptor check. Done means baidu-std can carry formats such as strings or JSON while callers handle packing and unpacking.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100