1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-06-25 02:27:10 +08:00

2.1.7 消息的 push 实现--补充

感觉这样对初学者而言更直观一点。
This commit is contained in:
daniubi 2021-06-29 19:05:05 +08:00 committed by GitHub
parent 5854bb9c4e
commit 06545375a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -172,6 +172,8 @@ class Broker {
1. 注意RocketMQ 已经说了自己会有低延迟问题,其中就包括这个消息的 push 延迟问题
2. 因为这并不是真正的将消息主动的推送到消费者,而是 Broker 定时任务每5s将消息推送到消费者
3. pull模式需要我们手动调用consumer拉消息而push模式则只需要我们提供一个listener即可实现对消息的监听而实际上RocketMQ的push模式是基于pull模式实现的它没有实现真正的push。
4. push方式里consumer把轮询过程封装了并注册MessageListener监听器取到消息后唤醒MessageListener的consumeMessage()来消费,对用户而言,感觉消息是被推送过来的。
### 2.1.8 消息重复发送的避免