fengling-console/.planning/phases/03-gateway-config-broadcast/03-PLAN.md

3.0 KiB
Raw Blame History

phase plan type wave depends_on files_modified autonomous requirements user_setup must_haves
03-gateway-config-broadcast 01 execute 1
true
truths artifacts key_links
现有广播机制已文档化
路由 -> 服务 -> 下游流程已理解
配置变更事件已验证可用
path provides
.planning/phases/03-gateway-config-broadcast/03-SUMMARY.md 阶段执行摘要
分析和文档化现有的网关配置广播机制。理解从路由配置到下游服务的完整链路,并验证配置变更事件广播是否正常工作。 @.planning/phases/01-gateway-config-management/01-SUMMARY.md @.planning/phases/01-gateway-config-management/01-PLAN.md

现有实现(来自 Phase 1

广播机制使用 PostgreSQL NOTIFY

  • 通道: gateway_config_changed
  • 事件类型: service, route, instance, gateway
  • 操作: create, update, delete, reload
  • 服务: ConfigNotificationService.cs
  • 集成: GatewayService.cs 在所有 CRUD 操作时触发广播
任务 1: 分析现有广播实现 src/Services/ConfigNotificationService.cs, src/Services/GatewayService.cs 分析现有实现以了解: 1. ConfigNotificationService 如何工作PostgreSQL NOTIFY 2. GatewayService 如何在 CRUD 操作时触发广播 3. 发送的事件类型和载荷是什么

阅读源代码并记录发现。 文件存在且包含通知逻辑 实现分析完成,发现已记录

任务 2: 绘制路由 -> 服务 -> 下游流程 文档化完整配置链路: 1. 路由如何在 Console 中定义 2. 路由如何映射到服务 3. 下游 Gateway 如何发现服务 4. 配置变更时,广播如何到达下游

参考 src/Models/、src/Services/、src/Controllers/ 中的现有代码 流程文档已创建 配置链路已文档化

任务 3: 验证广播端到端工作 验证广播机制: 1. 检查 PostgreSQL LISTEN/NOTIFY 是否正确配置 2. 验证 ReloadGatewayAsync 发送正确事件 3. 确认所有 CRUD 操作(服务/路由/实例)都触发广播 4. 如可能,测试端到端流程 编译成功API 端点可用 广播验证完成 1. 阅读并分析 ConfigNotificationService.cs 2. 阅读并分析 GatewayService.cs 3. 文档化路由 -> 服务 -> 下游流程 4. 验证编译通过

<success_criteria>

  • 现有广播实现已分析
  • 配置链路已文档化
  • 广播事件已验证
  • 摘要已创建 </success_criteria>
完成后创建 `.planning/phases/03-gateway-config-broadcast/03-SUMMARY.md`