feat(GOV-009): 建立后端契约与健康检查

This commit is contained in:
2026-08-13 17:26:51 +08:00
parent 3fc703de0b
commit 420aa22342
32 changed files with 1625 additions and 8 deletions
@@ -157,4 +157,19 @@ describe('进程级运行配置', () => {
expect(serialized).not.toContain('password');
expect(serialized).not.toContain('apiKey');
});
it('RocketMQ 在未落地已验证 Node 客户端前禁止启用', () => {
expect(() =>
loadSchedulerConfig({
APP_ENV: 'development',
LOG_LEVEL: 'debug',
SCHEDULER_TIMEZONE: 'Asia/Shanghai',
SCHEDULER_ENABLED: 'true',
...baseRedisEnv,
...disabledRocketMqEnv,
ROCKETMQ_ENABLED: 'true',
ROCKETMQ_SEND_TIMEOUT_MS: '3000',
}),
).toThrow(/RocketMQ Node 客户端/);
});
});
+2 -1
View File
@@ -191,7 +191,8 @@ function loadRocketMqConfig(env: EnvironmentSource): RocketMqRuntimeConfig {
const nameServerAddress = optionalText(env, 'ROCKETMQ_NAMESRV_ADDR');
const endpoint = optionalText(env, 'ROCKETMQ_ENDPOINT');
// GOV-009 尚不选择 Node RocketMQ 客户端;启用配置只在后续 Adapter 落地时允许启动。
// GOV-009 尚未选定通过真实链路验证的 Node 客户端,禁止以内存队列或空实现伪装启用。
if (enabled) throw new Error('RocketMQ Node 客户端尚未落地验证,当前禁止启用');
if (enabled && !nameServerAddress && !endpoint) {
throw new Error('ROCKETMQ_NAMESRV_ADDR 或 ROCKETMQ_ENDPOINT 至少填写一个');
}