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

mongodb client 支持 #1807

Open
zhangke96 opened this issue Jun 19, 2022 · 0 comments
Open

mongodb client 支持 #1807

zhangke96 opened this issue Jun 19, 2022 · 0 comments
Labels
feature new feature

Comments

@zhangke96
Copy link

Is your feature request related to a problem? (你需要的功能是否与某个问题有关?)
brpc支持请求mongodb服务,支持副本集。

Describe the solution you'd like (描述你期望的解决方法)
实现MongoDB Wire Protocol,使用Request Opcode OP_MSG。添加InsertRequest/Response,QueryRequest/Response,GetMoreRequest/Response(游标操作),CountRequest/Response,DeleteRequest/Response,UpdateRequest/Response,FindAndModifyRequest/Response protobuf定义,PackRequest转换为Mongo OP_MSG,ProcessResponse将解析Mongo OP_MSG,转换为pb。
副本集功能的支持,添加一个NamingService通过replSetGetStatus获取副本集中的各个节点的状态,返回PRIMARY节点。

Describe alternatives you've considered (描述你想到的折衷方案)
MongoDB文档没有详细描述CRUD操作的协议,因此可以通过编写MongoDB CRUD测试程序抓包模仿实现。

Additional context/screenshots (更多上下文/截图)
现在已经实现了mongo insert, find, getMore, count, delete, update, findAndModify操作,能够支持副本集(只会使用PRIMARY节点)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature new feature
Projects
None yet
Development

No branches or pull requests

2 participants