当前位置:网站首页>The wonderful relationship between message queue and express cabinet
The wonderful relationship between message queue and express cabinet
2022-07-07 23:00:00 【InfoQ】
One 、 The message queue is a delivery cabinet
- Message queues are compared to express cabinets: Many manufacturers produce express cabinets , Such as : Fengchao (apache kafka), Express mail (alibaba RocketMQ), Nearest neighbor treasure (ActiveMQ) wait , Anyway, these are the only ones commonly used . The express cabinet is responsible for temporary storage of mail , Message queue is responsible for temporarily saving message data .
- Couriers are compared to message producers: The courier is responsible for delivering mail to the express cabinet , The producer is responsible for delivering messages to the message queue . It's the same as different !
- Consumers are compared to news consumers: Maybe this example is too appropriate , So much so that this sentence is nonsense . Nonsense still needs to be said , Consumers in life pick up e-mail , Consumers in the program get message data .
Two 、 Express cabinet ( Message queue ) Benefits
- Asynchronous decoupling : With the express cabinet , Consumers don't have to wait for the courier , User experience enhancements . Consumers and producers ( Courier ) Decoupling between , Not because of the other party's operation behavior , Procedures that affect your independence . Users don't have to wait and receive events. Blocking takes time .
- Traffic peak clipping : Let's assume an extreme case , You bought... Through various channels 1000 This book , Suddenly, I'll call you intensively one hour . You certainly don't have the ability to charge for an hour 1000 The ability to send an email , So you ask the courier to put the mail in the express cabinet . So you can handle it according to your ability , Pick up the mail according to your own schedule . Similarly, our consumer programs are facing multiple users 、 In the case of highly concurrent requests , Putting the data into the message queue for saving can cut the peak of traffic data , Data consumption shall be carried out according to the processing capacity and resources of the program .
- Buffer batch : Batch delivery by producers , Shuang ! Consumers get multiple emails at one time , Shuang !
3、 ... and 、 Disadvantages of introducing express cabinet
- Introduce complexity . without doubt , Express cabinet ( Message queue ) This thing is extra , It doesn't exist in the original collection process . So I need a place to put it , Fire protection is also needed 、 Anti theft and moisture-proof , It needs to be maintained . The same is true for Message Queuing Middleware , You need to install it in the server area , And maintain it .
- It will cause temporary data inconsistency . If there is no express cabinet , When you receive an email, you really receive . But after using the express cabinet , You received " The message that the mail is put into the express cabinet ", But there will be a certain delay when you really get the email . Of course, you will eventually get the mail , choice " Message queue " Express cabinet , Is to endure temporary inconsistencies , Accept " Final consistency ".
- Of course, in extreme cases , The express cabinet is broken , You have to inevitably accept " Mail may be lost " Fact , For communities with high security coefficient, this will hardly happen .
边栏推荐
- Loki, the "open source star picking program", realizes the efficient management of harbor logs
- Debezium系列之:引入对 LATERAL 运算符的支持
- Line test - graphic reasoning -5- one stroke class
- 数字藏品加速出圈,MarsNFT助力多元化文旅经济!
- How to judge whether the input content is "number"
- Redis集群安装
- Unity and webgl love each other
- 详解全志V853上的ARM A7和RISC-V E907之间的通信方式
- Microbial health network, how to restore microbial communities
- Yarn开启ACL用户认证之后无法查看Yarn历史任务日志解决办法
猜你喜欢
「开源摘星计划」Loki实现Harbor日志的高效管理
Interview questions: how to test app performance?
ASP.NET Core入门五
消费品企业敏捷创新转型案例
Time convolution Network + soft threshold + attention mechanism to realize residual life prediction of mechanical equipment
Line test - graphic reasoning -7- different graphic classes
Gbu1510-asemi power supply special 15A rectifier bridge gbu1510
Line test - graphic reasoning - 3 - symmetric graphic class
DTC社群运营怎么做?
Line test - graphic reasoning - 4 - alphabetic class
随机推荐
ASEMI整流桥KBPC1510的型号数字代表什么
Robot autonomous exploration series papers environment code
Debezium系列之:支持 mysql8 的 set role 語句
C development - interprocess communication - named pipeline
Debezium系列之: 支持在 KILL 命令中使用变量
Failed to initialize rosdep after installing ROS
DTC社群运营怎么做?
PCL . VTK files and Mutual conversion of PCD
There is another problem just online... Warm
Microservice Remote debug, nocalhost + rainbond microservice Development second Bomb
行测-图形推理-4-字母类
Sword finger offer 27 Image of binary tree
Visual design form QT designer design gui single form program
IP network active evaluation system -- x-vision
知识点滴 - PCB制造工艺流程
Debezium series: binlogreader for source code reading
软件测评中心▏自动化测试有哪些基本流程和注意事项?
How to judge whether the input content is "number"
Microbial health network, how to restore microbial communities
行测-图形推理-1-汉字类