Reputation: 141
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
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
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