英文:
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:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论