fix: actually enable zstd compression for write write buffer (#6035)

Fixes #5981.
pull/24376/head
Marco Neumann 2022-11-02 09:09:35 +00:00 committed by GitHub
parent 45b3984aa3
commit e49f2ca5c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -25,7 +25,7 @@ use rskafka::{
client::{
consumer::{StartOffset, StreamConsumerBuilder},
error::{Error as RSKafkaError, ProtocolError},
partition::{OffsetAt, PartitionClient, UnknownTopicHandling},
partition::{Compression, OffsetAt, PartitionClient, UnknownTopicHandling},
producer::{BatchProducer, BatchProducerBuilder},
ClientBuilder,
},
@ -90,7 +90,8 @@ impl RSKafkaProducer {
);
let mut producer_builder =
BatchProducerBuilder::new_with_client(Arc::new(partition_client));
BatchProducerBuilder::new_with_client(Arc::new(partition_client))
.with_compression(Compression::Zstd);
if let Some(linger) = producer_config.linger {
producer_builder = producer_builder.with_linger(linger);
}