If the broker "compression.type" is "producer", then the broker retains
the original compression codec set by the producer.
  If the producer and broker codecs are different, then broker recompress
the data using broker "compression.type".

On Wed, Feb 14, 2018 at 10:58 AM, Uddhav Arote <aroteudd...@gmail.com>

> Hi Kafka users,
> I am trying to understand the behavior of compression in Kafka. Consider a
> scenario, where producer sets compression.codec "snappy" and broker's
> compression.code  "lz4"?
> In this scenario, what is the behavior of the compression?
> As far as I have understood is the following,
> The messages compressed by the producer are wrapped in the wrapper message
> and send to the broker. If the broker compression.codec is "producer", the
> message is written as is to the log.
> In the code,
> https://github.com/apache/kafka/blob/962bc638f9c2ab249e5008a587ee78
> e3ba35fcb9/core/src/main/scala/kafka/log/LogValidator.scala#L218
> what I understand is that if the producer and broker codecs are not same,
> then the compression should happen again.
> But I am not sure about this. Can somebody tell me how this works?
> Thanks,
> Uddhav

Reply via email to