Comments (1)
您好,
支付确实需要exactly-once,但是队列在整个支付流程中只是其中一个系统,即使队列完全实现了exactly-once,其它系统也要考虑幂等。既然业务本身需要考虑幂等,队列是at-least-once还是exactly-once就区别不大了。
据我了解,一个消息队列要做到exactly-once,也是要与业务一起配合的,需要做到如下两点:
- Producer生产支持幂等,这个容易实现;
- Consumer消费时对业务所做的状态变更,需要与偏移的更新保持同步;Kafka提出了以下两种做法:
2.1. 队列保存业务状态与偏移,保证两者的写是一个原子操作;如果consumer重启了,就取出偏移,作为消费开始位置;这里需要保存在同一个DB里,否则就变成了一个分布式事务,分布式事务的实现依赖队列,变成了先有鸡还是先有蛋的问题;
2.2. 业务保存业务状态与偏移,并提供幂等特性,忽略任何偏移值比存储偏移值小的写入。
from phxqueue.
Related Issues (20)
- bash build.sh 报错 HOT 1
- make[1]: *** 没有规则可以创建“test_propose_batch”需要的目标“test_propose_batch.o”。 停止 HOT 1
- 有计划支持C#的时间表吗 HOT 27
- PhxQueue可以用于跨大洲的消息队列吗?如果可以,性能和实时性如何? HOT 2
- 是否支持延迟投递的消息 HOT 1
- make报错 error: 'BaseDispatcher' in namespace 'phxrpc' does not name a template type HOT 1
- 启动store_server 报错 HOT 1
- should be auto read_sz = fread(buf.get(), 1, fileStat.st_size, fp ); instead of auto read_sz = fread(buf.get(), fileStat.st_size, 1, fp ) ?
- phxqueue文档能否丰富下? HOT 1
- 自动build失败 HOT 1
- Branch master sha1 df6c8de, git submodule phxrpc did not contain a1b7ce5c5ae633bac3d9df85ee874a1e8a82d353 HOT 2
- 执行build.sh编译,报错 HOT 3
- 消息队列与消息总线 HOT 1
- KeepSyncThread master 5s做一次消费进度同步,主从自动切换时会不会导致重复消费? HOT 1
- phxqueue/phxqueue/comm/utils/memory_util.h
- 假如一个storeId三个节点,某一个paxos instance实例slave所在节点重启,另外一个slave数据又有落后,可能会直接导致客户端消息发送失败?
- phxqueue的运行环境
- build.sh 出错
- phxqueue/producer/producer.cpp:105中打印顺序反了导致coredump
- 问下这个开源项目还有人维护吗? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phxqueue.