当前位置:网站首页>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 
边栏推荐
- 2022广东省安全员A证第三批(主要负责人)考试练习题及在线模拟考试
- 一次主从表集成流程开发过程
- [C language] pointer function, function pointer and array function
- [notes] notes on C language array pointer, structure + two-dimensional array pointer
- STM8S103f单片机的开发(1)LED灯的点亮
- P3379 [template] nearest common ancestor (LCA)
- How can JMeter parameterization be implemented?
- 单例模式和特殊类设计
- 【重庆大学】初试复试资料分享(附考研群)
- CVPR 2022 | 基于序列对比学习的长视频逐帧动作表示
猜你喜欢

UE5如何将屏幕坐标转为世界坐标和世界方向
[advanced MySQL] optimize SQL by using the execution plan explain (2)

Allan variance and random error identification

C#多线程学习笔记三

2022广东省安全员A证第三批(主要负责人)考试练习题及在线模拟考试

How to implement the association between interfaces in JMeter?

Operation of simulated examination platform for theoretical question bank of refrigeration and air conditioning equipment operation in 2022

LeetCode_ 21 (merge two ordered linked lists)

Flutter listview, column, row learning personal summary 2

C multithreading learning note 1
随机推荐
Why should the R & D effectiveness team of Internet companies be independent? When is independence?
CG碰撞检测 Collision Testing
LeetCode_21(合并两个有序链表)
[special introduction] round table forum -- the integration of AI and audio and video technology
KAtex problem - the style of equal sign alignment in CSDN editing
2022年危险化学品生产单位安全生产管理人员考试模拟100题及在线模拟考试
[logodetection data set processing] (2) draw the label box of the training set picture
CG collision testing
超强实操!手把手教学Kinect深度图与RGB摄像头的标定与配准
How to build Haojing technology when the computing power network is brought into reality?
[big guy show] aiops in the eyes of Borui data, choosing the right track and the right people
Still saying that university rankings are a joke? The latest regulation: Top50 universities in the world can be directly settled in Shanghai!
2022山东省安全员C证复训题库及在线模拟考试
[logodetection data set processing] (3) divide the training set into multiple folders by category
Operation of simulated examination platform for theoretical question bank of refrigeration and air conditioning equipment operation in 2022
【LogoDetection 数据集处理】(1)将数据集切分为训练集和验证集
C multithreading learning note 4
anaconda安装opencv(cv2),在jupyter notebook中使用
22.6.7 successfully use doc2vec model to generate embedded vectors
STM8S103f单片机的开发(1)LED灯的点亮