0
0
Kafkadevops~10 mins

Batch size and compression tuning 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 set the batch size for the Kafka producer.

Kafka
props.put("batch.size", [1]);
Drag options to blanks, or click blank then click option'
A1024
B16384
C512
D65536
Attempts:
3 left
💡 Hint
Common Mistakes
Using too small batch size reduces throughput.
Using too large batch size increases latency.
2fill in blank
medium

Complete the code to set the compression type for the Kafka producer.

Kafka
props.put("compression.type", [1]);
Drag options to blanks, or click blank then click option'
A"gzip"
B"snappy"
C"none"
D"lz4"
Attempts:
3 left
💡 Hint
Common Mistakes
Using compression type without quotes causes errors.
Choosing unsupported compression types.
3fill in blank
hard

Fix the error in setting linger.ms to control batching delay.

Kafka
props.put("linger.ms", [1]);
Drag options to blanks, or click blank then click option'
A"5"
B5000L
C"5000"
D5
Attempts:
3 left
💡 Hint
Common Mistakes
Using string instead of integer causes runtime errors.
Using long literals is unnecessary here.
4fill in blank
hard

Fill both blanks to create a producer config with batch size and compression type.

Kafka
props.put("batch.size", [1]);
props.put("compression.type", [2]);
Drag options to blanks, or click blank then click option'
A32768
B"snappy"
C"gzip"
D16384
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up batch size and compression values.
Using strings for batch size.
5fill in blank
hard

Fill all three blanks to configure batch size, linger.ms, and compression type.

Kafka
props.put("batch.size", [1]);
props.put("linger.ms", [2]);
props.put("compression.type", [3]);
Drag options to blanks, or click blank then click option'
A32768
B10
C"snappy"
D16384
Attempts:
3 left
💡 Hint
Common Mistakes
Using strings for numeric values.
Choosing unsupported compression types.