用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Dev-Toolbelt/dev-team-agents --skill event-driven命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | event-driven |
| description | Event-driven — sourcing, CQRS, saga, idempotency, schema registry. |
Load when the project uses message queues (Kafka, RabbitMQ, SQS, Pub/Sub), event stores, or distributed transactions.
| Pattern | Use when | Key constraint |
|---|---|---|
| Event Sourcing | Audit log required; time-travel queries needed | Event log is append-only; state derived on read |
| CQRS | Read and write models diverge; separate scaling needed | Two models must stay eventually consistent |
| Saga (Orchestration) | Central coordinator acceptable; easier debugging | Single point of failure in orchestrator |
| Saga (Choreography) | Loose coupling preferred; no central bottleneck | Harder to trace; each service reacts to events |
| Outbox Pattern | Atomicity between DB write and event publish required | Requires outbox table + background publisher |
| Type | Scope | Versioning |
|---|---|---|
| Domain event | Within a bounded context | Internal; break freely |
| Integration event | Crosses bounded contexts | Public contract; version explicitly |
Every consumer must handle duplicate events:
event_id column or Redis SET)Idempotency-Key header)| Strategy | Tooling | Trade-off |
|---|---|---|
| Schema registry | Confluent Registry, AWS Glue | Enforces contract; requires registry infra |
| Avro / Protobuf | Binary; backward/forward compatible with rules | Requires code generation |
| JSON Schema | Human-readable; no code gen | Weaker enforcement |
Backward-compatible changes: add optional fields, add enum values at end. Breaking changes: remove fields, rename fields, change types → require new event version.
causation_id and correlation_id| Failure | Mitigation |
|---|---|
| Consumer lag | Dead-letter queue (DLQ) + alerting on lag |
| Duplicate delivery | Idempotency (see above) |
| Ordering guarantee lost | Partition by entity ID; use sequence numbers |
| Event store grows unbounded | Snapshots: periodically collapse N events into current state |