From e49f2ca5c7e5a427190f15cda99c003480d0f113 Mon Sep 17 00:00:00 2001 From: Marco Neumann Date: Wed, 2 Nov 2022 09:09:35 +0000 Subject: [PATCH] fix: actually enable zstd compression for write write buffer (#6035) Fixes #5981. --- write_buffer/src/kafka/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/write_buffer/src/kafka/mod.rs b/write_buffer/src/kafka/mod.rs index 1d470f2221..a085cc8447 100644 --- a/write_buffer/src/kafka/mod.rs +++ b/write_buffer/src/kafka/mod.rs @@ -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); }