0

I am a newbie in Kafka.When using kafka 0.9.0, I can set a codec by setting the compression.type property of my kafka producer.

Suppose I use snappy compression in my producer, when consuming the messages from kafka using some kafka-consumer, should I do something to decode the data from snappy or is it some built-in feature of kafka consumer?

In the office doc, I could not find any property that relates to encoding in kafka consumer (it only relates to the producer).

Can someone clear this?

talamaki
  • 5,324
  • 1
  • 27
  • 40

1 Answers1

0

As mentioned in their wiki Page,there is no need for any decompression logic on the Consumer side:

Please have a look at their wiki page below:

https://cwiki.apache.org/confluence/display/KAFKA/Compression

The data received by a consumer for a topic might contain both compressed as well as uncompressed messages. The consumer iterator transparently decompresses compressed data and only returns an uncompressed message.

shankarsh15
  • 1,947
  • 1
  • 11
  • 16
  • Thanks, I got it.But I cannot received the message which compressed. Do you known the reason? Thanks in advance. – Shaolu Xu May 26 '16 at 01:45