M0-02 Event Bus & Reliability 基础版 #2

Open
opened 2026-05-22 21:00:15 +08:00 by wangdl · 0 comments
Owner

实施状态 — 全部完成

模块 说明
BullMQ 基础设施 4 个队列:ai-analysis, document-import, notification, domain-events
EventBusService publish() 同步 + publishAsync() 异步
BaseDomainEvent eventId/occurredAt/eventType
Admin Events AAPI GET/POST /admin-api/events 队列管理
Admin Web 页面 admin.longde.cloud → 系统运维 → 事件队列

Admin AAPI

端点 说明
GET /admin-api/events 所有队列统计
GET /admin-api/events/:queue/failed 失败任务列表
GET /admin-api/events/:queue/jobs/:id 任务详情
POST /admin-api/events/:queue/jobs/:id/retry 手动重试

Admin Web

页面 路径 说明
事件队列 /events 队列概览表格 + 失败任务列表 + 重试按钮
入口 侧边栏 → 系统运维 → 事件队列 SUPER_ADMIN only

交付检查

  • EventBusService
  • 同步事件 EventEmitter2
  • 异步事件 BullMQ
  • 事件持久化
  • 重试策略
  • 死信队列
  • 幂等键
  • Admin AAPI
  • Admin Web 页面
  • 日志脱敏
## 实施状态 — ✅ 全部完成 | 模块 | 说明 | |------|------| | BullMQ 基础设施 | 4 个队列:ai-analysis, document-import, notification, domain-events | | EventBusService | publish() 同步 + publishAsync() 异步 | | BaseDomainEvent | eventId/occurredAt/eventType | | Admin Events AAPI | GET/POST /admin-api/events 队列管理 | | Admin Web 页面 | admin.longde.cloud → 系统运维 → 事件队列 | ### Admin AAPI | 端点 | 说明 | |------|------| | GET /admin-api/events | 所有队列统计 | | GET /admin-api/events/:queue/failed | 失败任务列表 | | GET /admin-api/events/:queue/jobs/:id | 任务详情 | | POST /admin-api/events/:queue/jobs/:id/retry | 手动重试 | ### Admin Web | 页面 | 路径 | 说明 | |------|------|------| | 事件队列 | /events | 队列概览表格 + 失败任务列表 + 重试按钮 | | 入口 | 侧边栏 → 系统运维 → 事件队列 | SUPER_ADMIN only | ### 交付检查 - [x] EventBusService - [x] 同步事件 EventEmitter2 - [x] 异步事件 BullMQ - [x] 事件持久化 - [x] 重试策略 - [x] 死信队列 - [x] 幂等键 - [x] Admin AAPI - [x] Admin Web 页面 - [x] 日志脱敏
wangdl added this to the M0:后端基础能力与架构规范闭环(P0) milestone 2026-05-22 21:00:15 +08:00
wangdl self-assigned this 2026-05-22 21:00:15 +08:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wangdl/api-server#2
No description provided.