0
0
Kafkadevops~10 mins

Batching and linger configuration 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 linger time to 100 milliseconds.

Kafka
props.put("linger.ms", [1]);
Drag options to blanks, or click blank then click option'
A"10"
B"1000"
C"0"
D"100"
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1000 instead of 100 causes longer delay.
Setting linger.ms to 0 disables batching delay.
2fill in blank
medium

Complete the code to set the batch size to 32 KB.

Kafka
props.put("batch.size", [1]);
Drag options to blanks, or click blank then click option'
A"32768"
B"16384"
C"65536"
D"8192"
Attempts:
3 left
💡 Hint
Common Mistakes
Using 16384 sets batch size to 16 KB instead of 32 KB.
Confusing batch size units with linger.ms units.
3fill in blank
hard

Fix the error in setting linger.ms to 1000 (1 second) in the code.

Kafka
props.put("linger.ms", [1]);
Drag options to blanks, or click blank then click option'
A1000
B"1000"
C1
D100
Attempts:
3 left
💡 Hint
Common Mistakes
Using integer 1000 instead of string "1000".
Using 1 instead of 1000 changes the linger time.
4fill in blank
hard

Fill both blanks to configure batch size to 16 KB and linger time to 50 ms.

Kafka
props.put("batch.size", [1]);
props.put("linger.ms", [2]);
Drag options to blanks, or click blank then click option'
A"16384"
B"50"
C"100"
D"32768"
Attempts:
3 left
💡 Hint
Common Mistakes
Using integer values instead of strings.
Mixing up batch size and linger.ms values.
5fill in blank
hard

Fill all three blanks to configure batch size 64 KB, linger time 200 ms, and enable compression with 'snappy'.

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'
A"65536"
B"200"
C"snappy"
D"gzip"
Attempts:
3 left
💡 Hint
Common Mistakes
Using integer values instead of strings.
Choosing wrong compression type like 'gzip' instead of 'snappy'.