Complete the code to set the batch size for the Kafka producer.
props.put("batch.size", [1]);
The batch size is typically set to 16384 bytes (16 KB) for efficient batching.
Complete the code to set the compression type for the Kafka producer.
props.put("compression.type", [1]);
Setting compression.type to "gzip" enables gzip compression for messages.
Fix the error in setting linger.ms to control batching delay.
props.put("linger.ms", [1]);
linger.ms expects an integer value, so 5 without quotes is correct.
Fill both blanks to create a producer config with batch size and compression type.
props.put("batch.size", [1]); props.put("compression.type", [2]);
Batch size is set to 16384 bytes and compression.type to "gzip" for good performance.
Fill all three blanks to configure batch size, linger.ms, and compression type.
props.put("batch.size", [1]); props.put("linger.ms", [2]); props.put("compression.type", [3]);
Batch size is 16384 bytes, linger.ms is 10 ms, and compression.type is "snappy" for balanced performance.