-
Notifications
You must be signed in to change notification settings - Fork 1
Design
Geng Zhang edited this page Feb 22, 2017
·
4 revisions
目前模块划分及其依赖如下:
模块名 | 中文名 | 说明 | 依赖 |
---|---|---|---|
common | 公共模块 | utils、数据结构 | 无 |
core | 核心模块 | 各种基本流程、消息、上下文、扩展接口等 | common |
config | 配置实现模块 | 例如spring,annotation,spring-boot等 | core |
bootstrap | 启动实现模块 | 启动类,发布或者引用服务逻辑、以及registry的操作 | core |
proxy | 代理实现模块 | 接口实现代理生成 | core |
client | 客户端实现模块 | 发送请求、接收响应、连接维护、路由、负载均衡、同步异步等 | core |
server | 服务端实现模块 | 启动监听、接收请求,发送响应、业务线程分发等 | core |
filter | 拦截器实现模块 | 服务端和客户端的各种拦截器实现 | core |
codec | 编解码实现模块 | 例如压缩,序列化等 | core |
protocol | 协议实现模块 | 协议的包装处理、协商 | core |
transport | 网络传输实现模块 | TCP连接的建立,数据分包粘包处理,请求响应对象分发等 | core |
registry | 注册中心实现模块 | 实现注册中心,例如zk等 | core |
all | 打包配置模块 | 打成All-in-one的jar包,发布用 | 以上所有 |
example | 例子模块 | 各种Feature的Demo | all |
各个实现类都只在自己模块中出现,不交叉依赖。需要交叉依赖的全部已经抽象到core模块中。
对RPC的各个关键都可以进行扩展,目前已有的扩展点如下:
接口名 | 中文名 | 备注 | 内置实现 |
---|---|---|---|
io.bsoa.rpc.client.Client | 客户端 | Failover,Failfast,Pinpoint | |
io.bsoa.rpc.client.ConnectionHolder | 连接管理器 | AllConnect(全部连接), |
|
io.bsoa.rpc.client.LoadBalancer | 负载均衡 | 随机、轮询、最少并发、一致性hash、本机优先 | |
io.bsoa.rpc.codec.Compressor | 压缩 | snappy、quicklz | |
io.bsoa.rpc.codec.Serializer | 序列化器 | java、hessian、 |
|
io.bsoa.rpc.filter.Filter | 拦截器 | ||
io.bsoa.rpc.protocol.Protocol | 协议 | bsoa、 |
|
io.bsoa.rpc.protocol.ProtocolDecoder | 协议解码 | bsoa、 |
|
io.bsoa.rpc.protocol.ProtocolEncoder | 协议编码 | bsoa、 |
|
io.bsoa.rpc.protocol.TelnetHandler | telnet的响应 | version、help、ls | |
io.bsoa.rpc.proxy.Proxy | 代理类 | java、javassist | |
io.bsoa.rpc.registry.Registry | 注册中心 | zookeeper、redis、etcd | |
io.bsoa.rpc.server.Server | 服务端实现 | bsoa | |
io.bsoa.rpc.transport.ClientTransport | 客户端长连接实现 | netty | |
io.bsoa.rpc.transport.ServerTransport | 服务端长连接实现 | netty |
Copyright www.bsoa.io 2016-2017