Kafka 与传统消息队列(如 RabbitMQ)在关键方面不同 — 它是一个分布式日志,保留事件(而不是消费时删除),支持重放,提供非常高的吞吐量,并使用基于拉取和分区的模型。理解这些差异有助于明确何时使用每种系统。
关键差异
TRADITIONAL QUEUE (e.g. RabbitMQ) → messages are typically DELETED once consumed:
→ a message goes to a consumer and is removed (transient)
→ push-based often; rich routing; per-message acknowledgment
KAFKA → a durable, retained LOG of events:
→ events are STORED (retained for a period), NOT deleted on consumption
→ multiple consumers/groups can read the SAME events independently
→ REPLAY → re-read past events (rewind to any offset)
→ pull-based; partition-based ordering and scaling; very high throughput
