简体   繁体   English

我可以让一个组的所有使用者都从kafka主题的所有分区中消费消息吗?

[英]Can I have all the consumers of a group consume message from all the partitions of a kafka topic?

Let's say in Kafka I have 4 partitions of a topic 'A' and I have 20 consumers of Consumer Group 'AC'. 假设在Kafka中,我有4个主题“ A”的分区,而我有20个“ AC”消费者组的消费者。 I don't need any ordering, but I want to process the messages faster by scaling my consumer instances. 我不需要任何排序,但是我想通过扩展使用者实例来更快地处理消息。 Please note all messages are independent and can be processed independently. 请注意,所有消息都是独立的,可以独立处理。

I looked at a consumer configuration partition.assignment.strategy , but not sure if I can achieve dynamic assignment of consumer to partition, depending on the message availability. 我查看了使用者配置partition.assignment.strategy ,但不确定是否可以根据消息可用性将使用者动态分配到分区。

One partition is assigned to exactly one consumer in the group. 一个分区分配给组中的一个使用者。 In your case you have only 4 consumers on 20 which are currently working. 在您的情况下,您只有20个工作中的4个消费者。 You have to increase partitions number if you want more assigned consumers. 如果要分配更多的使用者,则必须增加分区数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Kafka 消费者可以从所有分区消费吗 - Can Kafka consumers consume from all partitions 如何向 kafka 主题的所有消费者发送相同的消息? - How do I send the same message to all consumers of a kafka topic? 服务不使用来自 AWS Kafka 集群上所有主题消费者组的消息 - service not consume message from all topic consumer group on AWS Kafka Cluster 我可以让Kafka使用者/接收器连接以跳过主题中的特定分区吗? - Can I have Kafka consumers/sink connects to skip specific partitions within a topic? 如何为具有多个分区的 Kafka 主题启动多个使用者? - How can I start multiple consumers for a Kafka topic with multiple partitions? 在Kafka中,是否在主题的所有分区中复制了每条消息? - In Kafka is each message replicated across all partitions of a topic? 如何在单个 kafka 主题的所有分区中写入相同的消息? - how to write same message in all partitions of a single kafka topic? 并非所有 kafka 消费者都被分配到分区 - Not all kafka consumers are getting assigned to partitions Spring 引导 Kafka:使用特定主题的所有实例使用相同的消息 - Spring Boot Kafka: Consume same message with all instances for specific topic 如何在服务的所有实例中使用 Kafka 中的消息 - How can i consume a message in Kafka in all the instances of a service
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM