0
0
Kafkadevops~10 mins

Cooperative vs eager rebalancing in Kafka - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the rebalance protocol to eager.

Kafka
props.put("partition.assignment.strategy", "[1]");
Drag options to blanks, or click blank then click option'
Aorg.apache.kafka.clients.consumer.CooperativeStickyAssignor
Borg.apache.kafka.clients.consumer.StickyAssignor
Corg.apache.kafka.clients.consumer.EagerAssignor
Dorg.apache.kafka.clients.consumer.RangeAssignor
Attempts:
3 left
💡 Hint
Common Mistakes
Using CooperativeStickyAssignor instead of EagerAssignor
Using RangeAssignor which is not eager
Misspelling the assignor class name
2fill in blank
medium

Complete the code to set the rebalance protocol to cooperative.

Kafka
props.put("partition.assignment.strategy", "[1]");
Drag options to blanks, or click blank then click option'
Aorg.apache.kafka.clients.consumer.CooperativeStickyAssignor
Borg.apache.kafka.clients.consumer.EagerAssignor
Corg.apache.kafka.clients.consumer.RangeAssignor
Dorg.apache.kafka.clients.consumer.StickyAssignor
Attempts:
3 left
💡 Hint
Common Mistakes
Using EagerAssignor instead of CooperativeStickyAssignor
Using StickyAssignor which is not cooperative
Using RangeAssignor which is neither cooperative nor eager
3fill in blank
hard

Fix the error in the rebalance strategy assignment to use cooperative rebalancing.

Kafka
props.put("partition.assignment.strategy", "[1]");
Drag options to blanks, or click blank then click option'
Aorg.apache.kafka.clients.consumer.CooperativeStickyAssignor
Borg.apache.kafka.clients.consumer.EagerAssignor
Corg.apache.kafka.clients.consumer.RangeAssignor
Dorg.apache.kafka.clients.consumer.StickyAssignor
Attempts:
3 left
💡 Hint
Common Mistakes
Using EagerAssignor for cooperative rebalancing
Using StickyAssignor which is not cooperative
Using RangeAssignor which is not cooperative
4fill in blank
hard

Fill both blanks to configure a Kafka consumer for cooperative rebalancing with the correct assignor and enable incremental cooperative rebalancing.

Kafka
props.put("partition.assignment.strategy", "[1]");
props.put("rebalance.protocol", "[2]");
Drag options to blanks, or click blank then click option'
Aorg.apache.kafka.clients.consumer.CooperativeStickyAssignor
Beager
Ccooperative-sticky
Dorg.apache.kafka.clients.consumer.EagerAssignor
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing eager assignor with cooperative rebalance protocol
Using 'eager' as the assignor class
Using 'cooperative-sticky' as the assignor class
5fill in blank
hard

Fill all three blanks to create a Kafka consumer configuration that uses eager rebalancing with the correct assignor, rebalance protocol, and session timeout.

Kafka
props.put("partition.assignment.strategy", "[1]");
props.put("rebalance.protocol", "[2]");
props.put("session.timeout.ms", [3]);
Drag options to blanks, or click blank then click option'
Aorg.apache.kafka.clients.consumer.CooperativeStickyAssignor
Beager
C30000
Dorg.apache.kafka.clients.consumer.EagerAssignor
Attempts:
3 left
💡 Hint
Common Mistakes
Using CooperativeStickyAssignor with eager protocol
Setting session.timeout.ms as a string instead of a number
Mixing rebalance protocols and assignors