Skip to content

Commit

Permalink
add log on error.
Browse files Browse the repository at this point in the history
  • Loading branch information
hoseinaghaei committed Feb 15, 2024
1 parent 0c14213 commit b63f9f0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kafka_server/broker/file/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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):
Expand Down

0 comments on commit b63f9f0

Please sign in to comment.