消费者组在Kafka中的需求是什么?

huangapple go评论50阅读模式
英文:

What is the need of consumer group in kafka?

问题

我不理解Kafka中消费者组的实际用途。在消费者组中,一个分区只能被一个消费者读取,因此一个主题记录的子集只能被一个消费者读取。

可以有人帮助解释消费者组有助于哪些实际场景吗?

英文:

I don't understand the practical use case of the consumer group in Kafka.
A partition can only be read by only one consumer in a consumer group, so only a subset of a topic record is read by one consumer.

Can someone help with any practical scenario where the consumer group helps?

答案1

得分: 2

这是用于特定主题的事件消息的并行处理。

消费者使用消费者组名称来标识自己,每个发布到主题的记录都会传递给订阅消费者组中的一个消费者实例。消费者实例可以位于不同的进程或不同的机器上。

如果所有消费者实例都属于相同的消费者组,那么记录将有效地在消费者实例之间负载平衡

如果所有消费者实例都属于不同的消费者组,那么每条记录将广播到所有消费进程。

了解更多信息:

英文:

It's for parallel processing of event messages from the specific topic.

> Consumers label themselves with a consumer group name, and each record published to a topic is delivered to one consumer instance within each subscribing consumer group. Consumer instances can be in separate processes or on separate machines.

> If all the consumer instances have the same consumer group, then the records will effectively be load balanced over the consumer instances.

> If all the consumer instances have different consumer groups, then each record will be broadcast to all the consumer processes.

Read more here:

huangapple
  • 本文由 发表于 2023年2月9日 03:39:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/75390937.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定