Kafka: linger.ms=0 does not mean every record is sent alone

The default of 0 means 'do not wait deliberately', not 'no batching'. Records still accumulate while a request is in flight, so throughput is bursty and unpredictable - and a small linger usually makes it both faster and steadier.

Full code & output

This topic is available to PRO members.

Sign in Create a free account

Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.

Published 2026-08-25