Skip to content

Commit 31e55d5

Browse files
committed
更新readme
1 parent 554dc6e commit 31e55d5

2 files changed

Lines changed: 124 additions & 0 deletions

File tree

README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,68 @@ The project is organized into the following modules to ensure separation of conc
3636
| **`python_client`** | Python client implementation demonstrating cross-language gRPC interoperability. |
3737
| **`go_client`** | Go client implementation demonstrating cross-language gRPC interoperability. |
3838

39+
### System Architecture Diagram
40+
41+
```mermaid
42+
flowchart LR
43+
subgraph External["External Systems"]
44+
E1["python_client (grpc-python)"]
45+
E2["go_client (grpc-go)"]
46+
E3["Nacos Registry"]
47+
end
48+
49+
subgraph Internal["Internal Components"]
50+
subgraph Clients["Java Clients"]
51+
C1["rpc-consumer"]
52+
C2["Spring Boot App"]
53+
end
54+
55+
subgraph Core["rpc-core (Microkernel)"]
56+
P1["ProxyFactory (JDK/ByteBuddy)"]
57+
P2["RpcClient / RpcServer"]
58+
P3["ExtensionLoader (SPI)"]
59+
end
60+
61+
subgraph Plugins["SPI Plugins"]
62+
S1["Protocol: Netty / HTTP / HTTP2 / gRPC"]
63+
S2["Serializer: Protobuf / Kryo / JSON / Java"]
64+
S3["LoadBalancer: RoundRobin / Random"]
65+
S4["Registry: Nacos / Local"]
66+
S5["Transport: rpc-transport-netty"]
67+
end
68+
69+
subgraph Provider["Service Provider"]
70+
M1["rpc-provider"]
71+
M2["HelloServiceImpl"]
72+
end
73+
end
74+
75+
A1["rpc-api (service interfaces)"]
76+
A2["rpc-common (RpcRequest/RpcResponse + proto)"]
77+
78+
C1 --> P1
79+
C2 --> P1
80+
E1 -->|gRPC / HTTP2 + Protobuf| S1
81+
E2 -->|gRPC / HTTP2 + Protobuf| S1
82+
P1 --> P2
83+
P2 --> S3
84+
P2 --> S4
85+
P2 --> S5
86+
P2 --> S2
87+
S5 --> S1
88+
S1 --> M1
89+
M1 --> M2
90+
S4 <-->|service register/discover| E3
91+
A1 -.shared API.-> C1
92+
A1 -.shared API.-> M1
93+
A2 -.shared model.-> P2
94+
P3 -.loads.-> S1
95+
P3 -.loads.-> S2
96+
P3 -.loads.-> S3
97+
P3 -.loads.-> S4
98+
P3 -.loads.-> S5
99+
```
100+
39101
## ✨ Key Features
40102

41103
- **🔌 Plugin-based Architecture**: Leverages a custom SPI mechanism for maximum flexibility.

README_ZH.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,68 @@
3535
| **`python_client`** | Python 客户端实现,用于演示跨语言 gRPC 互操作性。 |
3636
| **`go_client`** | Go 客户端实现,用于演示跨语言 gRPC 互操作性。 |
3737

38+
### 系统架构图
39+
40+
```mermaid
41+
flowchart LR
42+
subgraph External["外部系统"]
43+
E1["python_client (grpc-python)"]
44+
E2["go_client (grpc-go)"]
45+
E3["Nacos 注册中心"]
46+
end
47+
48+
subgraph Internal["内部组件"]
49+
subgraph Clients["Java 客户端"]
50+
C1["rpc-consumer"]
51+
C2["Spring Boot 应用"]
52+
end
53+
54+
subgraph Core["rpc-core (微内核)"]
55+
P1["ProxyFactory (JDK/ByteBuddy)"]
56+
P2["RpcClient / RpcServer"]
57+
P3["ExtensionLoader (SPI)"]
58+
end
59+
60+
subgraph Plugins["SPI 插件层"]
61+
S1["Protocol: Netty / HTTP / HTTP2 / gRPC"]
62+
S2["Serializer: Protobuf / Kryo / JSON / Java"]
63+
S3["LoadBalancer: RoundRobin / Random"]
64+
S4["Registry: Nacos / Local"]
65+
S5["Transport: rpc-transport-netty"]
66+
end
67+
68+
subgraph Provider["服务提供端"]
69+
M1["rpc-provider"]
70+
M2["HelloServiceImpl"]
71+
end
72+
end
73+
74+
A1["rpc-api (服务接口)"]
75+
A2["rpc-common (请求响应模型 + proto)"]
76+
77+
C1 --> P1
78+
C2 --> P1
79+
E1 -->|gRPC / HTTP2 + Protobuf| S1
80+
E2 -->|gRPC / HTTP2 + Protobuf| S1
81+
P1 --> P2
82+
P2 --> S3
83+
P2 --> S4
84+
P2 --> S5
85+
P2 --> S2
86+
S5 --> S1
87+
S1 --> M1
88+
M1 --> M2
89+
S4 <-->|服务注册/发现| E3
90+
A1 -.共享接口.-> C1
91+
A1 -.共享接口.-> M1
92+
A2 -.共享模型.-> P2
93+
P3 -.加载.-> S1
94+
P3 -.加载.-> S2
95+
P3 -.加载.-> S3
96+
P3 -.加载.-> S4
97+
P3 -.加载.-> S5
98+
```
99+
38100
## ✨ 核心特性
39101

40102
- **🔌 插件化架构**: 采用自定义 SPI 机制,实现最大程度的灵活性。

0 commit comments

Comments
 (0)