当前位置:网站首页>Consumption mode of Message Oriented Middleware
Consumption mode of Message Oriented Middleware
2022-06-10 14:32:00 【morningcat2018】
The consumption pattern of message oriented middleware
Push Pattern :
advantage The message can be sent to consumers as soon as possible ( stay Pull In this mode, you need to constantly pull messages , Because I don't know whether there are new messages in the message queue )
Inferiority The server does not know the consumption capacity of the consumer , Constantly sending messages may cause the consumer side buffer to overflow
ActiveMQ Use in prefetch limit Address these weaknesses
When the number of push messages reaches perfetch limit Specified value , The consumer has not yet returned to the message oriented middleware ACK, Message oriented middleware will no longer push messages to consumers
If the number of messages is small ( Producers are producing messages at a slow rate ), But every message Consumers need a long time to deal with , that prefetch limit Set to 1 More appropriate .
prefetch limit Set to 0 It means at this time , The consumer polls the message middleware to get the message . No more Push Way , It is Pull Way . That is, consumers take the initiative to pull messages from the message middleware .
Pull Pattern :
advantage The consumer end can be pulled out according to the processing capacity
Inferiority Will increase message latency ( Consumers don't know when there is news , Can only keep pulling messages , But not too often ; Therefore, a time is usually set , Pull it every once in a while , This time is the message delay time )
Implementation of various message oriented middleware
- RabbitMQ
- Consumers default to push mode ( It also supports pull mode )
- Kafka Pull mode
- utilize “ Long polling ” To implement pull mode
- Consumers go to Broker Pull the news , Defines a timeout period , In other words, consumers ask for information , If so, return the message immediately , If not, the consumer waits until the timeout , And then send a pull message request again
- RocketMQ Pull mode
Long polling
RocketMQ Long polling 
Kafka Long polling 
边栏推荐
- CVPR 2022 | frame by frame motion representation of long video based on sequence contrast learning
- c#浅拷贝与深拷贝自定义的类的List<>
- SIGIR 2022 | HKU and Wuhan University put forward kgcl: a recommendation system based on knowledge map comparative learning
- 2022 practice questions and online simulation test for the third batch of Guangdong Provincial Safety Officer a certificate (principal)
- CVPR 2022 | 基于序列对比学习的长视频逐帧动作表示
- 几种方式可以实现 JMeter 参数化?
- 【LogoDetection 数据集处理】(1)将数据集切分为训练集和验证集
- LeetCode_ 21 (merge two ordered linked lists)
- 这个牛逼的低代码生成器,现在开源了!
- 【Vue/js】通过localStorage浏览器实现变量和对象的本地缓存(图文+完整源代码)
猜你喜欢

还在说大学排名是笑话?最新规定:世界top50大学可以直接落户上海!

IIC总线的主要特点/通信过程/读写过程

How to implement the association between interfaces in JMeter?

数仓的基本概念

CVPR 2022 | 基于序列对比学习的长视频逐帧动作表示

算力网络照进现实,浩鲸科技如何构建?

What is CAS and ABA in CAS

Singleton pattern and special class design

Beijing / Shanghai internal promotion | recruitment of full-time interns in the system and network group of Microsoft Research Asia

洞见科技入选「爱分析· 隐私计算厂商全景报告」,获评金融解决方案代表厂商
随机推荐
Design tools and skills for beginners to build their own blog
How to write a global notice component?
Even some people say that ArrayList is twice as large. Today, I will take you to tear up the ArrayList source code
Notes on the second test of C language
[special introduction] round table forum -- the integration of AI and audio and video technology
如何写一个全局的 Notice 组件?
2022年制冷与空调设备运行操作理论题库模拟考试平台操作
Generate a dataset of training vectors for doc2vec
Insight Technology a été sélectionné dans le rapport panorama des fournisseurs d'analyse de l'amour et d'informatique de la vie privée et a été évalué comme représentant des fournisseurs de solutions
1
C#多线程学习笔记三
Binary tree and Figure 2
Kotlin bubbling algorithm, Gaud map filters out the data whose distance between two points is less than 50, and does not repeat the display
Brief description of adaptive function
Binary tree and figure 1
Shutter wrap button bottomnavigationbar learning summary 4
QT transfers the received JSON data (including Chinese) Unicode to utf8
【离散数学期复习系列】一、命题逻辑
C#多线程学习笔记二
UE5如何将屏幕坐标转为世界坐标和世界方向