Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the command to list consumer groups in Kafka.
Kafka
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --list --[1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--list' with '--describe' together incorrectly
Omitting the '--group' option when describing a group
✗ Incorrect
The correct option is 'group' to specify the consumer group when listing or describing groups.
2fill in blank
mediumComplete the command to describe a specific consumer group named 'my-group'.
Kafka
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong or default group name
Omitting the group name
✗ Incorrect
The consumer group to describe is 'my-group' as specified in the instruction.
3fill in blank
hardFix the error in the command to monitor consumer lag by completing the missing option.
Kafka
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --describe --group my-group --[1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--lag' which is not a valid option
Using '--reset-offsets' which changes offsets instead of showing lag
✗ Incorrect
The '--offsets' option is used to show the current offsets and lag for the consumer group.
4fill in blank
hardFill both blanks to create a command that resets the consumer group offsets to the earliest position.
Kafka
kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group my-group --[1] --to-[2] earliest --execute
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--describe' instead of '--reset-offsets'
Using '--to-latest' instead of '--to-earliest'
✗ Incorrect
The command uses '--reset-offsets' to reset offsets and '--to-earliest' to set them to the earliest position.
5fill in blank
hardFill all three blanks to create a command that describes consumer group 'analytics', shows lag, and uses a specific bootstrap server.
Kafka
kafka-consumer-groups.sh --bootstrap-server [1] --describe --group [2] --[3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong bootstrap server address
Using wrong group name
Omitting the '--offsets' option
✗ Incorrect
The command uses 'localhost:9092' as the bootstrap server, 'analytics' as the group, and '--offsets' to show lag.