知识卡片
异步流程需处理乱序重复
异步消息可能迟到、重复或乱序,预订流程不能默认恰好处理一次或按发送顺序完成。消费者须具备幂等性,并为状态追踪、补偿与用户可见的处理中状态设计明确规则。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
原书出处
参考来源
- 位置:《Principles of Software Architecture Modernization》第3章《Anti-Patterns: Distributed Monoliths》(源文件:`_epub-src/OPS/ch03.xhtml`,归一化正文 [16784:20954))
- 结论依据:原文列出消息延迟、重复、顺序和界面反馈四类风险,并指出可用幂等处理重复;补偿与状态呈现是相应的设计推论。
- 原始内容:Duplication: Not all messaging systems guarantee that messages will be processed only once; or an event may appear multiple times. Ordering: If you do not have strict ordering, how does your system behave when messages are consumed in different orders?