compression.type

The producer setting that compresses each batch with a codec such as gzip, snappy, lz4 or zstd before sending it.

In more detail

Compression works on whole batches, so bigger batches compress better. It saves network bandwidth and disk space at the cost of processor time on both the producer and the consumer.

Example

KafkaProducer(compression_type='gzip')

Related terms

Taught in

References

Certification courses