Onkar
Onkar

Reputation: 141

Where to set compression.type property in Kafka

I want to implement compression for Kafka messages. For that compression.type must be set. In which property file it should be set?

Upvotes: 2

Views: 13236

Answers (2)

Katya Gorshkova
Katya Gorshkova

Reputation: 1561

If you set compression.type property in the configuration of the producer, then the messages will be compressed before sending them to the broker. If you set this property in the server configuration, then it specifies how the messages will be compressed in the broker. In the server side you can also specify producer, which means use the compression type set by the producer.

Upvotes: 3

bistros
bistros

Reputation: 1179

you can add ProducerConfig (https://kafka.apache.org/documentation/#producerconfigs )

it support gzip, snappy, lz4

and Topic's Config also be set . ( https://kafka.apache.org/documentation/#topicconfigs )

and, consumer does not need to be set (auto detecting)

Upvotes: 2

Related Questions