Git Product home page Git Product logo

rbbitmq_localmessagetable's Introduction

rabbitmq 本地消息表实现分布式事务

参照原理图 Image text

依照消息表保证 提供者这边操作的原子性。消费方注意幂等性问题。

  1. 插入订单记录时,保存一条消息到本地消息表中,状态字段变为未发送,保证原子性。
  2. 轮询扫描订单的本地消息表,找出所有未发送的记录,进行消息发送。
  3. 消息发送成功,执行Confirm的回调,修改消息表中的状态为已发送
  4. 消费方采用手动ack机制+重试机制,接收到消息后先进行幂等性判断,然后在处理自己的逻辑。
  5. 消费方异常,本地事务回滚,触发重试,重试失败,ack无法签收,本地消息表状态也无法修改, 保证一致性。
  6. 提供方要确保 插入订单记录 和 插入订单本地消息表 要在同一事务下面。

rbbitmq_localmessagetable's People

Contributors

tangxiaonian avatar

Stargazers

Joey W avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.