0
0
Kafkadevops~10 mins

Static group membership in Kafka - Interactive Code Practice

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

Complete the code to enable static group membership by setting the group instance ID.

Kafka
props.put("group.instance.id", [1]);
Drag options to blanks, or click blank then click option'
A"auto"
B"my-static-instance"
C"random"
D"dynamic"
Attempts:
3 left
💡 Hint
Common Mistakes
Using dynamic or random strings for group.instance.id
Not setting group.instance.id at all
2fill in blank
medium

Complete the code to configure the consumer to use static group membership by setting the correct property.

Kafka
consumerConfig.put([1], "my-static-instance");
Drag options to blanks, or click blank then click option'
A"group.instance.id"
B"client.id"
C"session.timeout.ms"
D"group.id"
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing group.id with group.instance.id
Setting client.id instead
3fill in blank
hard

Fix the error in the code to correctly set static group membership in the consumer properties.

Kafka
props.put("[1]", "static-instance-1");
Drag options to blanks, or click blank then click option'
Agroup.id
Bclient.id
Cgroup.instance.id
Dgroup.instance
Attempts:
3 left
💡 Hint
Common Mistakes
Using group.id instead of group.instance.id
Misspelling the property name
4fill in blank
hard

Fill both blanks to create a consumer configuration that enables static group membership with a unique instance ID.

Kafka
consumerProps.put([1], "my-group");
consumerProps.put([2], "instance-123");
Drag options to blanks, or click blank then click option'
A"group.id"
B"group.instance.id"
C"client.id"
D"session.timeout.ms"
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the two property names
Using client.id instead of group.instance.id
5fill in blank
hard

Fill all three blanks to create a Kafka consumer configuration that sets the group ID, static instance ID, and client ID.

Kafka
props.put([1], "my-group");
props.put([2], "static-instance-01");
props.put([3], "client-01");
Drag options to blanks, or click blank then click option'
A"group.instance.id"
B"group.id"
C"client.id"
D"session.timeout.ms"
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the property names
Not setting client.id when required