Reputation: 10876
I'm working through the very first section of the Confluent Tutorials: https://kafka-tutorials.confluent.io/kafka-console-consumer-producer-basics/kafka.html. Everything works as described, but I notice there's about 1 second of lag between when I press enter in the producer terminal and when a message is displayed in the consumer terminal. Is it the producer or the consumer who's responsible for this lag/batching? Is there a way to configure things to be more responsive? A quick search turned up the linger.ms
setting, but it seems like recent versions of Kafka default this setting to zero, and it doesn't appear to be overridden in these containers.
Upvotes: 0
Views: 80
Reputation: 10876
Ok, it looks like setting --timeout=0
in the producer makes the lag disappear. Looking at the kafka-console-producer
source code, --timeout
defaults to 1000 and gets merged into LINGER_MS_CONFIG
. So even though linger defaults to zero in Kafka generally, it effectively defaults to 1 sec in this command line producer.
Upvotes: 1