Senior
Question 6. 10 messages are added to a Kafka topic, and 2 consumers with different consumer groups read from the topic. How many messages does each consumer read? - 5 - 10 - Depends on the number of partitions in the topic - Depends on the value of replicationFactor
sobes.tech AI
Answer from AI
Each consumer in its consumer group receives all messages from the topic. In Kafka, a consumer group ensures parallel processing of messages by distributing partitions among consumers within the group.
In this case:
- There are 10 messages in the topic.
- Two consumers are in different consumer groups.
Therefore, each consumer will receive all 10 messages, regardless of the number of partitions and the replication factor.
Answer: 10 messages.