From b63f9f011ff4bc65e919b3d5f118290d246dbcc2 Mon Sep 17 00:00:00 2001 From: hoseinaghaei Date: Thu, 15 Feb 2024 05:59:58 +0330 Subject: [PATCH] add log on error. --- kafka_server/broker/file/read.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kafka_server/broker/file/read.py b/kafka_server/broker/file/read.py index f4e8d96..b0eb161 100644 --- a/kafka_server/broker/file/read.py +++ b/kafka_server/broker/file/read.py @@ -140,6 +140,7 @@ def get_subscribers(): with open(subscriptions_file_path, 'r', encoding='utf8') as f: subscribers = json.load(f) + print("Found {} subscribers".format(subscribers)) return subscribers @@ -164,7 +165,10 @@ def choose_subscriber(self): id_to_key = {} for i, key in enumerate(self.subscribers.keys()): id_to_key[i] = key + + print("id_to_key", id_to_key) chosen_key = id_to_key[read_index % subscriber_count] + print("chosen_key", chosen_key) return chosen_key, self.subscribers[chosen_key] def load_message_in_fly(self):