From 925c0760facc5fb7375ef80d3b65f331d84ae90a Mon Sep 17 00:00:00 2001 From: Jakub Drobena Date: Wed, 8 Nov 2023 13:58:26 +0100 Subject: [PATCH] Set compression level for messages --- ccx_messaging/publishers/kafka_publisher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccx_messaging/publishers/kafka_publisher.py b/ccx_messaging/publishers/kafka_publisher.py index 1b0026b..6376fc8 100644 --- a/ccx_messaging/publishers/kafka_publisher.py +++ b/ccx_messaging/publishers/kafka_publisher.py @@ -70,7 +70,7 @@ def __init__(self, outgoing_topic: str, kafka_broker_config: dict = None, **kwar def produce(self, outgoing_message: bytes): """Send the message though the Kafka producer.""" if self.compression: - self.producer.produce(self.topic, gzip.compress(outgoing_message)) + self.producer.produce(self.topic, gzip.compress(outgoing_message,compresslevel=9)) else: self.producer.produce(self.topic, outgoing_message) self.producer.poll(0)