Update 消息队列.md

补充消费者组与分区分配的示意图。
This commit is contained in:
CyC2018
2026-10-25 19:34:20 +08:00
parent 3170d61a07
commit cbcdd7aa88
2 changed files with 2 additions and 0 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

+2
View File
@@ -34,6 +34,8 @@
Kafka、RocketMQ 等通过消费者组把两种模型结合起来:一条消息会发送给每个订阅它的消费者组,但在一个消费者组内只会被一个消费者消费。
<div align="center"> <img src="pics/consumer-group.png" width="560px"/> </div><br>
发布与订阅模式和观察者模式有以下不同:
- 观察者模式中,观察者和主题都知道对方的存在;而在发布与订阅模式中,生产者与消费者不知道对方的存在,它们之间通过频道进行通信。