Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions moksha.hub/moksha/hub/monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ def poll(self):
"consumers": self.serialize(self.hub.consumers),
"producers": self.serialize(self.hub.producers),
}
# Decode topics if they are byte array
# This will prevent the json.dumps() to fail
for consumer in data["consumers"]:
decoded_topics = []
for topic in consumer["topic"]:
if isinstance(topic, bytes):
decoded_topics.append(topic.decode())
if decoded_topics:
consumer["topic"] = decoded_topics

if self.socket:
self.socket.send_string(json.dumps(data))

Expand Down