Skip to content

Commit 04c55fe

Browse files
committed
refactor(run): remove legacy run command and associated files
- Delete the run command implementation, including client configuration generation and flag handling - Update architecture documentation to reflect the removal of the run command - Transition to using the new server command for starting services with flexible component selection - Ensure backward compatibility by guiding users to the new command structure
1 parent baf269e commit 04c55fe

File tree

2 files changed

+24
-35
lines changed

2 files changed

+24
-35
lines changed

cmd/run/wire.go

Lines changed: 0 additions & 29 deletions
This file was deleted.

doc/ARCHITECTURE_REFACTOR.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ MOON_RABBIT_SERVER_ENABLE_JOB=true \
201201

202202
```
203203
┌─────────────────────────────────┐
204-
│ rabbit run
204+
│ rabbit server
205205
│ ┌──────────┐ ┌─────────────┐ │
206206
│ │ HTTP │ │ EventBus │ │
207207
│ │ gRPC │ │ Workers │ │
@@ -292,6 +292,18 @@ cmd/
292292
./rabbit job
293293
```
294294

295+
**选项 3:使用独立命令(精细控制)**
296+
```bash
297+
# 只启动 HTTP
298+
./rabbit http
299+
300+
# 只启动 gRPC
301+
./rabbit grpc
302+
303+
# 只启动 Job
304+
./rabbit job
305+
```
306+
295307
### 配置文件
296308

297309
所有命令使用相同的配置文件格式,无需修改配置文件。只需要确保配置文件路径正确:
@@ -304,6 +316,8 @@ cmd/
304316
./rabbit grpc --config /path/to/config
305317
```
306318

319+
**注意**`rabbit run` 命令已被移除,请使用 `rabbit server --http --grpc --job` 替代。
320+
307321
## 🎓 最佳实践
308322

309323
### 生产环境部署
@@ -322,11 +336,15 @@ cmd/
322336

323337
### 开发环境
324338

325-
使用 `run` 命令,方便本地开发和调试:
339+
使用 `server` 命令,方便本地开发和调试:
326340

327341
```bash
328-
# 本地开发,同时启动所有服务
329-
./rabbit run --config ./config
342+
# 本地开发,同时启动所有服务(HTTP + gRPC + Job)
343+
./rabbit server --http --grpc --job --config ./config
344+
345+
# 或者只启动需要的组件
346+
./rabbit server --http --grpc --config ./config
347+
./rabbit job --config ./config
330348
```
331349

332350
### 监控指标
@@ -352,9 +370,9 @@ A: 不是。根据你的需求:
352370
- 如果只需要处理消息,只部署 Job
353371
- 如果需要完整功能,同时部署两者
354372

355-
### Q: Run 命令会被废弃吗
373+
### Q: Run 命令去哪了
356374

357-
A: 不会。Run 命令会一直保留,用于开发、测试和小规模部署场景
375+
A: `rabbit run` 命令已被移除。请使用 `rabbit server --http --grpc --job` 来替代原来的 `run` 命令功能。这样可以更灵活地控制启动哪些组件
358376

359377
### Q: Server 和 Job 可以共享同一个数据库吗?
360378

0 commit comments

Comments
 (0)