知识卡片
事件通知保留查询关口
事件通知只告知重要变化,携带最少标识和详情入口,消费者需另行查询才能处理。这样可避免敏感详情进入消息基础设施,并在查询处再次鉴权;对易过时的信息,可在读取时取得最新状态。代价是处理仍依赖生产者可用性,不能把短通知误认为完整数据副本。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 事件驱动架构 · 查看原书依据
The event notification should not be verbose: the goal is to notify the interested parties about the event, but the notification shouldn’t carry all the information needed for the subscribers to react to the event. For example: { "type": "paycheck-generated", "event-id": "537ec7c2-d1a1-2005-8654-96aee1116b72", "delivery-id": "05011927-a328-4860-a106-737b2929db4e", "timestamp": 1615726445, "payload": { "employee-id": "456123", "link": "/paychecks/456123/2021/01" } } In
参考来源
- 位置:《Learning Domain-Driven Design》第15章《事件驱动架构》(来源项目:a19c7933-4eda-4176-aebd-30fe7e1ad292;源文件:extracted/Learning Domain-Driven Design/_epub-src/OEBPS/ch15.html)
- 结论依据:原文定义简短通知,并以安全与并发解释显式查询的价值。
- 原始内容:The event notification should not be verbose: the goal is to notify the interested parties about the event, but the notification shouldn’t carry all the information needed for the subscribers to react to the event. For example: { "type": "paycheck-generated", "event-id": "537ec7c2-d1a1-2005-8654-96aee1116b72", "delivery-id": "05011927-a328-4860-a106-737b2929db4e", "timestamp": 1615726445, "payload": { "employee-id": "456123", "link": "/paychecks/456123/2021/01" } } In