Consumer Groups

All the Consumers in an application read data as a Consumer Group.

Each Consumer within a group reads from exclusive partitions.

If the number of Consumers exceeds the number of available Partitions in a Topic, then all Consumers over the max number of Partitions will be inactive.

It is acceptable for multiple Consumer Groups to read from the same Topic Partitions.

To create distinct consumer groups in Apache Kafka, you use the consumer property group.id

Pasted image 20230301205448.webp

Pasted image 20230301205532.webp

Pasted image 20230301205821.webp

References

Flashcards

Consumer Groups::: A collection of consumers that work together to read and process messages from Topics.

Each Consumer within a Consumer Groups reads:: a subset of partitions ensuring that every message is read by only one consumer within the group.

Partition count limits what in a Consumer Groups:: the number of active Consumers

True/false it is acceptable for multiple Consumer Groups to read from the same Topic Partitions:: true

Consumer Groups are uniquely identified by::: group.id

A topic receives all the orders for the products that are available on a commerce site. Two applications want to process all the messages independently - order fulfilment and monitoring. The topic has 4 partitions, how would you organise the consumers for optimal performance and resource usage?:: Create two consumer groups for two applications with 4 consumers in each

There are two consumers C1 and C2 belonging to the same group G subscribed to topics T1 and T2. Each of the topics has 3 partitions. How will the partitions be assigned to consumers with PartitionAssignor being RoundRobinAssignor?:: C1 will be assigned partitions 0 and 2 from T1 and partition 1 from T2. C2 will have partition 1 from T1 and partitions 0 and 2 from T2.

Which actions will trigger partition rebalance for a consumer group? (select three)

Two consumers share the same group.id (consumer group id). Each consumer will:: Read all the data on mutual exclusive partitions

You have a consumer group of 12 consumers and when a consumer gets killed by the process management system, rather abruptly, it does not trigger a graceful shutdown of your consumer. Therefore, it takes up to 10 seconds for a rebalance to happen. The business would like to have a 3 seconds rebalance time. What should you do? (select two)