feat(processing): 领域/投影/终态三步提交与 FlightProjectionPort(ACM2-79)

PIPELINE_LOCK 跨 Redis 写;MSG_EVENT HELD→PENDING;Redis 失败不终态不投递;V3 迁移。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
windyboy
2026-09-21 15:24:34 +08:00
co-authored by Cursor
parent 891088235c
commit 2c3d6af309
28 changed files with 928 additions and 167 deletions
+4 -1
View File
@@ -54,6 +54,8 @@
| `msgx.identity.include-day-boundary` | `false` | 去重时是否把日期算进消息身份;受 `C-3` 约束,不能随意改变 | 默认关闭 |
| `msgx.health.backlog-cache-ttl-ms` | `30000` ms | `/health``/metrics` 共用的未处理消息统计最多缓存多久;`0` 表示每次重算 | 暂定 |
| `msgx.history.history-store-enabled` | `false` | 是否启用历史航班写入;关闭时不删除实时航班 | 默认关闭 |
| `msgx.redis.enabled` | `false` | 是否把航班快照写进 Redis 查询投影;关闭时投影写入是空操作(`G-REDIS-PROJECTION` | 默认关闭 |
| `msgx.redis.flight-key` | `flightInfo` | 航班快照所在的 Redis 哈希键,字段名是 `FLID` | 沿用旧系统 |
| `msgx.history.planned-age-days` | `3` 天 | `US-14` AC2 条件 1:计划时间早于当前超过该天数视为已结束 | `US-14` AC2 |
| `msgx.history.cancelled-hours` | `1` 小时 | `US-14` AC2 条件 2:取消时间早于当前超过该窗口视为已结束 | `US-14` AC2 |
| `msgx.history.diverted-hours` | `1` 小时 | `US-14` AC2 条件 3:备降且计划时间早于当前超过该窗口;备降依据 `FDIV``DDES`/`DDIR`)落地前不参与判定(`Q3`、ACM2-100 | `US-14` AC2 |
@@ -90,7 +92,7 @@
**缺值**:带环境变量占位的必需键(`MSGX_PG_URL``MSGX_MAILBOX_URL``MSGX_KAFKA_SERVERS` 等)缺失时由 DI 解析失败拒绝启动,无需自检代码。
**显式开关(非配置错误)**`msgx.stubs``datasources.default.enabled``mailbox.shared-mysql.enabled``msgx.history.history-store-enabled``msgx.pipeline.autostart`。默认关闭是"未接入"的显式声明,不判违规;只有 `msgx.pipeline.autostart=true` 才要求依赖齐备。Kafka 运行时不可达不是配置错误,归 `/health` 与投递指标告警(`OPS-2`)。
**显式开关(非配置错误)**`msgx.stubs``datasources.default.enabled``mailbox.shared-mysql.enabled``msgx.history.history-store-enabled``msgx.redis.enabled``msgx.pipeline.autostart`。默认关闭是"未接入"的显式声明,不判违规;只有 `msgx.pipeline.autostart=true` 才要求依赖齐备。Kafka 运行时不可达不是配置错误,归 `/health` 与投递指标告警(`OPS-2`)。
## 指标与健康
@@ -121,6 +123,7 @@
| 读取信箱与 HTTP 入口 | `ingress/InboxPoller.kt``ingress/InboxController.kt` |
| XML 解析 | `codec/JacksonXmlCodec.kt``codec/SisWireMapper.kt` |
| 顺序处理与航班变更 | `processing/Pump.kt``processing/DynamicProcessors.kt``processing/ScheduleProcessor.kt` |
| 三步提交与 Redis 投影 | `processing/FlightCommit.kt``processing/FlightProjection.kt``infra/projection/` |
| 写回信箱与发送 Kafka | `processing/BackfillService.kt``delivery/Dispatcher.kt``infra/kafka/KafkaDeliveryPort.kt` |
| 定时任务 | `jobs/JobRunner.kt``jobs/HistorySweepJob.kt``jobs/EventCleanupJob.kt` |
| 数据库读写与手动重试 | `infra/persistence/jdbc/``infra/retry/` |