0
votes

I want to compress the messages in kafka. So I have enabled the compression type as gzip on producer side and didn't changed anything on server.propeties.

config.put(ProducerConfig.COMPRESSION_TYPE_CONFIG, "gzip");

This is the code I have added in the producer configuration, but when I am sending the messages to the topic and when i am reading them in comsumer side the messages are not compressed. Can anyone suggest how to do message compression at producer side in kafka. I am using JAVA and Springboot.

Thanks in advance.

1

1 Answers

1
votes

The consumer auto-detects the applied compression and uncompresses the data.

Using a compression (e.g. on Producer side as you have done it) means that the data is compressed when stored physically on disk. You can check this by loocking into the data-log of your Kafka topic and compare the content when using and when not using a compression.