Four knobs
Anatomy of a producer
A Kafka producer batches records per partition, optionally compresses, and sends asynchronously. The four configuration knobs you must understand:
acks— durability contract (see L1).linger.ms+batch.size— throughput vs latency.compression.type—snappy,lz4,zstd,gzip.enable.idempotence=true— guarantees no per-partition duplicates on retry.