Skip to content

Commit

Permalink
Send recent activities via eda
Browse files Browse the repository at this point in the history
  • Loading branch information
zMardone committed Apr 17, 2024
1 parent 4d8088e commit 707598d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bothub/common/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

from django_elasticsearch_dsl.registries import registry

from bothub.event_driven.publisher.rabbitmq_publisher import RabbitMQPublisher
from bothub import translate
from bothub.celery import app
from bothub.common.models import (
Expand Down Expand Up @@ -688,5 +689,10 @@ def create_repository_project(**kwargs):

@app.task(name="send_recent_activity")
def send_recent_activity(recent_activity_data):
connect_client = ConnectClient()
connect_client.create_recent_activity(recent_activity_data=recent_activity_data)
rabbitmq_publisher = RabbitMQPublisher()
rabbitmq_publisher.send_message(
body=recent_activity_data,
exchange="recent-activities.topic",
routing_key="",
)
print(f"[ intelligencePublisher ] message sent - {recent_activity_data} to recent-activities.topic")

0 comments on commit 707598d

Please sign in to comment.