Complete the code to set the linger time to 100 milliseconds.
props.put("linger.ms", [1]);
The linger.ms property controls how long the producer waits before sending a batch. Setting it to 100 means 100 milliseconds.
Complete the code to set the batch size to 32 KB.
props.put("batch.size", [1]);
The batch.size property is in bytes. 32 KB equals 32768 bytes.
Fix the error in setting linger.ms to 1000 (1 second) in the code.
props.put("linger.ms", [1]);
Kafka configuration properties expect string values, so "1000" is correct.
Fill both blanks to configure batch size to 16 KB and linger time to 50 ms.
props.put("batch.size", [1]); props.put("linger.ms", [2]);
Batch size 16 KB is 16384 bytes, and linger.ms 50 means 50 milliseconds.
Fill all three blanks to configure batch size 64 KB, linger time 200 ms, and enable compression with 'snappy'.
props.put("batch.size", [1]); props.put("linger.ms", [2]); props.put("compression.type", [3]);
Batch size 64 KB is 65536 bytes, linger.ms 200 means 200 milliseconds, and compression.type 'snappy' enables Snappy compression.