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



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)
- A consumer in a consumer group shuts down
- Add a new consumer to consumer group
- Remove a broker from the cluster
- Add a broker to the cluster
- Increase partitions of a topic
? - A consumer in a consumer group shuts down
- Add a new consumer to consumer group
- Increase partitions of a topic
Rebalance occurs when a new consumer is added, removed or consumer dies or paritions increased.
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)
- Decrease session.timeout.ms
- decrease max.poll.interval.ms
- Increase heartbeat.interval.ms
- Decrease heartbeat.interval.ms
- increase max.poll.interval.ms
- Increase session.timeout.ms
? - Decrease session.timeout.ms
- Decrease heartbeat.interval.ms
session.timeout.ms must be decreased to 3 seconds to allow for a faster rebalance, and the heartbeat thread must be quicker, so we also need to decrease heartbeat.interval.ms