知识卡片

结构图卡 · 2285.l.20

发件箱保证至少一次

理解等级:高级

业务写库与发消息跨资源,无法依赖单一数据库事务。发件箱把待发事件与领域数据写进同库同事务,再由调度器发布并删除。发布后、删除提交前崩溃会导致重发,因此保证至少一次而非恰好一次;消费者必须允许重复。工作流也可持久记录“业务已完成、消息待发送”,承担同类恢复职责。

结构图:

flowchart TD
业务事务 --> 更新领域数据
业务事务 --> 写入待发事件
更新领域数据 --> 同库原子提交
写入待发事件 --> 同库原子提交
同库原子提交 --> 调度发送
调度发送 --> 删除待发记录
调度发送 -->|发送后崩溃| 可能重复发布
这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 工作流引擎与集成挑战 · 查看原书依据

      The outbox pattern, as visualized in Figure 9-13, can solve this problem. In a typical implementation of this pattern, the service writes the event that needs to be published to a separate table in the same relational database where the domain data resides. This table is called the outbox. Having a table in the same

    参考来源

    - 位置:《Practical Process Automation》第9章《工作流引擎与集成挑战》(来源项目:book-sources;源文件:extracted/Practical Process Automation (Bernd Ruecker)/_epub-src/OEBPS/ch09.xhtml) - 结论依据:原文给出的机制、实例与边界支持本卡的解释。 - 原始内容:The outbox pattern, as visualized in Figure 9-13, can solve this problem. In a typical implementation of this pattern, the service writes the event that needs to be published to a separate table in the same relational database where the domain data resides. This table is called the outbox. Having a table in the same