Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问代码中是怎么解决消息队列冥等的问题的啊 #14

Open
uestctang opened this issue Mar 5, 2020 · 5 comments
Open

Comments

@uestctang
Copy link

下单后通过消息队列发送到撮合,撮合是怎么判断这个订单有没有处理过

@oldfritter
Copy link
Owner

@uestctang 目前的撮合逻辑是
1.将订单写入数据库。
2.向消息队列发送消息。
3.撮合引擎收到消息后,从数据库中取出对应订单做撮合成交处理,没有成功产生成交的,压入待撮合数据的栈。
4.当撮合引擎重启时,预先加载数据库中未成交的订单入待撮合的栈,之后开始接收队列中的消息。
这应该能解释你的疑问

@oldfritter
Copy link
Owner

oldfritter commented Apr 9, 2020

消息队列的幂等应该由rabbitmq解决,
不应该在业务代码中解决,不是吗

@liyoujun123456
Copy link

3.撮合引擎收到消息后,从数据库中取出对应订单做撮合成交处理

撮合引擎收到消息后,应该是从RabbitMQ中取出对应订单做撮合成交处理吧?

另外请问有整个项目的架构图吗?可以分享一下吗?

@dongfengyuli
Copy link

你好,这个项目你跑起来了吗??能加个微信咨询一下吗??

@oldfritter
Copy link
Owner

@dongfengyuli 代码可用,有问题可以发我邮件 [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants