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

能否提供一个非RPC协议的demo #358

Open
XW512 opened this issue Aug 28, 2024 · 2 comments
Open

能否提供一个非RPC协议的demo #358

XW512 opened this issue Aug 28, 2024 · 2 comments

Comments

@XW512
Copy link

XW512 commented Aug 28, 2024

现在线上的项目有使用socket协议, 我方位服务端或客户端的其中一端, 协议由双方共同协定, 在此框架上自定义私有协议, 包括 Command 类型、Command 处理器、编解码处理器 还是挺有难度的, 能否提供自定义协议的单元测试模块, 供参考, 谢谢!

@OrezzerO
Copy link
Collaborator

建议是直接看 RPC 的 demo. 正如你所说这不是一个简单的工作,而RPC这块是一个很好的DEMO, 完整呈现了 bolt 要如何使用.

可以先将 com.alipay.remoting.rpc.protocol.RpcProtocol 类作为入口. 看下 Encoder / Decoder/ 和 CommandHandler 是如何协作的, 仿照 RpcProtocol 按自己的理解写个demo 出来. 再分析你们的需求有什么特殊点,根据特殊点再进行细节调整.

@chuailiwu
Copy link
Collaborator

https://www.infoq.cn/article/e5buirfgjvzrqt7vrmz4 可以参考下这个文档有自定义协议的介绍

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

No branches or pull requests

3 participants