feat: 一阶段
All checks were successful
序列化结构检查 / serialization-schema-check (push) Successful in 1s

This commit is contained in:
2026-07-15 16:48:46 +08:00
parent 14f9f1fce7
commit e88408e9b6
16 changed files with 789 additions and 37 deletions

View File

@@ -43,8 +43,11 @@ include_modules:
`redisCheck` 仓库维护,随 jar 发布,默认包含:
- `detection.patterns`**W01~W05**JSON 字符串写入 + Template 直写 + Hash
- `detection.mq_patterns`**MQ01/MQ02、MQ-K01/MQ-K02**RocketMQ / Kafka 生产侧)
- `detection.read_hints_enabled`W06 读侧反序列化类型辅助(默认 true
- `detection.mq_read_hints_enabled`MQ 读侧补强Phase M2默认 false
- `ignore.key_patterns`(锁 / 计数器 / token
- `ignore.mq_destinations`MQ destination 忽略,默认真空)
- `detection.min_confidence``max_field_depth`
- `mode: notify``enabled: true`
@@ -97,6 +100,9 @@ ignore:
# 忽略的写入方法(类全名#方法名)
writer_methods: []
# 忽略的 MQ destinationtopic 或 topic:tagglob
mq_destinations: []
# 检测规则
detection:
# 启用的写入模式(默认已全部开启)
@@ -107,9 +113,19 @@ detection:
- W04 # redisTemplate 直写对象
- W05 # opsForHash().put
# MQ 生产侧投递Phase M1
mq_patterns:
- MQ01 # rocketMQTemplate.syncSend
- MQ02 # asyncSend / syncSendOrderly / sendOneWay
- MQ-K01 # kafkaTemplate.send(topic, payload)
- MQ-K02 # kafkaTemplate.send(topic, key, payload)
# W06读侧反序列化类型辅助不产生独立告警
read_hints_enabled: true
# MQ-R 读侧补强Phase M2默认关闭
mq_read_hints_enabled: false
# 类型推断最低置信度,低于此值标记为低置信度提示
min_confidence: 0.6
@@ -223,7 +239,8 @@ detection:
- **不是写入模式**:不会单独因为「多了一处 parse」而告警
- 能关联到 `redis get(key)` 时,还可补强 unresolved key
- 覆盖优先级:`manual_mappings` > W06 > 写侧 AST
- 覆盖优先级:`manual_mappings` > W06 > 写侧 AST
- **仅补强 Redis 写入点**MQ 投递点不走 W06MQ-R 为 Phase M2
关闭示例:
@@ -232,6 +249,18 @@ detection:
read_hints_enabled: false
```
### 3.5.2 detection.mq_patterns / ignore.mq_destinationsMQ Phase M1
| 配置项 | 说明 |
|--------|------|
| `mq_patterns` | `MQ01`/`MQ02`RocketMQ`MQ-K01`/`MQ-K02`Kafka默认已开启 |
| `mq_read_hints_enabled` | MQ-R 读侧补强,**默认 false** |
| `ignore.mq_destinations` | 忽略 destinationglob`benchmark:*` |
企微 MQ 块:`- Topic --> ...`,并带 `> **通道**: RocketMQ|Kafka`
详见:[MQ序列化结构检测方案.md](./MQ序列化结构检测方案.md)
### 3.6 manual_mappings
当自动推断不准确时使用。匹配优先级 **高于** 自动推断(按 `类全名#方法名` 覆盖 key 模式与 value 类型)。
@@ -346,10 +375,10 @@ include_modules: [] # 全仓
---
## 7. 扩展:MQ 消息体检测(方案阶段
## 7. MQ 消息体检测(Phase M1 已落地
MQ**RocketMQ + Kafka**)消息体 Schema 变更监控方案已单独成文,**实现前不要求业务仓增配**
同一 jar 默认启用 RocketMQ / Kafka **生产侧**投递检测(`detection.mq_patterns`),与 Redis 共用 Diff、骨架与企微模板
详见:[MQ序列化结构检测方案.md](./MQ序列化结构检测方案.md)
届时预计新增:`detection.mq_patterns`(含 `MQ01~``MQ-K01~`)、`detection.mq_read_hints_enabled``ignore.mq_destinations`
- 配置说明见 §3.5.2
- 读侧 MQ-R、`MessageBuilder` / `ProducerRecord` 等见方案 Phase M2
- 完整设计:[MQ序列化结构检测方案.md](./MQ序列化结构检测方案.md)