我不明白Kafka中消费者组的实际用例。 一个分区只能被一个消费者组中的一个消费者读取,因此一个消费者只能读取主题记录的子集。
有人可以帮助解决消费者群体可以提供帮助的任何实际场景吗?
最佳答案
它用于并行处理来自特定主题的事件消息。
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.
在这里阅读更多内容:
关于apache-kafka - kafka中的消费群体有什么需求?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75390937/