feat(config): 配置值非法无条件拒启,登记启动必需配置清单(ACM2-97)

- 新增 PipelineConfigCheck(@Context):退避档位/播种取值校验不再等 autostart(CLM-7、OPS-1)
- OperationDayZoneCheck 扩展 cutoff-hour 0-23 校验
- reference.md 新增「启动必需配置与显式开关」:必需清单、缺值路径、显式开关与运行时故障的边界
- PipelinePropsBindingTest 补一致退避档位;补非法值/范围用例
This commit is contained in:
windyboy
2026-09-21 12:46:47 +08:00
parent 9bf879ff76
commit 477f038cc1
7 changed files with 89 additions and 7 deletions
+16
View File
@@ -78,6 +78,22 @@
环境变量名见 [`.env.example`](../.env.example);其余基础设施键见 `src/main/resources/application.yml`
### 启动必需配置与显式开关(`CLM-7`、`OPS-1`
**值非法即拒绝启动**(无条件自检,不等 `autostart`):
| 校验 | 条件 | 依据 |
|---|---|---|
| `msgx.operation-day.zone` | 必须是可解析的 IANA 时区 | `PARAM:msgx.operation-day.zone` |
| `msgx.operation-day.cutoff-hour` | 取值 023 | `PARAM:msgx.operation-day.cutoff-hour` |
| `kafka.producers.default.acks` / `enable-idempotence` / `max-in-flight-requests-per-connection` | 联合满足幂等生产前提(`all`+`true`+`1`;旧 Broker 降级组合见 `D2` | `D2` |
| `msgx.pipeline.backoff-ms` | 档位数必须等于 `max-attempts - 1` | 退避表(implementation.md「参数」) |
| `msgx.pipeline.cutover-watermark` | 仅 `min`/`zero`/`max`/数字 | 切流播种(`G-SCAN-PREDICATE` 前) |
**缺值**:带环境变量占位的必需键(`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`)。
## 指标与健康
| 指标 | 含义 | 关注信号 |