diff --git a/monkey/common/event_queue/pypubsub_event_queue.py b/monkey/common/event_queue/pypubsub_event_queue.py index 82bdc9567..ad191fb24 100644 --- a/monkey/common/event_queue/pypubsub_event_queue.py +++ b/monkey/common/event_queue/pypubsub_event_queue.py @@ -32,13 +32,15 @@ class PyPubSubEventQueue(IEventQueue): self._pypubsub_publisher.subscribe(listener=subscriber, topicName=tag) def publish(self, event: AbstractEvent): + event_data = {"event": event} + # publish to event type's topic event_type_name = event.__name__ - self._pypubsub_publisher.sendMessage(event_type_name, event) + self._pypubsub_publisher.sendMessage(event_type_name, **event_data) # publish to all events' topic - self._pypubsub_publisher.sendMessage(INTERNAL_ALL_EVENT_TYPES_TOPIC, event) + self._pypubsub_publisher.sendMessage(INTERNAL_ALL_EVENT_TYPES_TOPIC, **event_data) # publish to tags' topics for tag in event.tags: - self._pypubsub_publisher.sendMessage(tag, event) + self._pypubsub_publisher.sendMessage(tag, **event_data)