Skip to content

Commit

Permalink
feat: update topic names for events
Browse files Browse the repository at this point in the history
  • Loading branch information
alangsto committed Oct 4, 2023
1 parent 42bc974 commit e8db7e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 5 additions & 4 deletions edx_exams/apps/core/signals/handlers.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Signal handlers for the edx-exams application.
"""
from django.conf import settings
from django.dispatch import receiver
from openedx_events.event_bus import get_producer
from openedx_events.learning.signals import (
Expand All @@ -18,7 +19,7 @@ def listen_for_exam_attempt_submitted(sender, signal, **kwargs): # pylint: disa
"""
get_producer().send(
signal=EXAM_ATTEMPT_SUBMITTED,
topic='exam-attempt-submitted',
topic=getattr(settings, 'EXAM_ATTEMPT_EVENTS_KAFKA_TOPIC_NAME', ''),
event_key_field='exam_attempt.course_key',
event_data={'exam_attempt': kwargs['exam_attempt']},
event_metadata=kwargs['metadata'],
Expand All @@ -32,7 +33,7 @@ def listen_for_exam_attempt_verified(sender, signal, **kwargs): # pylint: disab
"""
get_producer().send(
signal=EXAM_ATTEMPT_VERIFIED,
topic='exam-attempt-verified',
topic=getattr(settings, 'EXAM_ATTEMPT_EVENTS_KAFKA_TOPIC_NAME', ''),
event_key_field='exam_attempt.course_key',
event_data={'exam_attempt': kwargs['exam_attempt']},
event_metadata=kwargs['metadata'],
Expand All @@ -46,7 +47,7 @@ def listen_for_exam_attempt_rejected(sender, signal, **kwargs): # pylint: disab
"""
get_producer().send(
signal=EXAM_ATTEMPT_REJECTED,
topic='exam-attempt-rejected',
topic=getattr(settings, 'EXAM_ATTEMPT_EVENTS_KAFKA_TOPIC_NAME', ''),
event_key_field='exam_attempt.course_key',
event_data={'exam_attempt': kwargs['exam_attempt']},
event_metadata=kwargs['metadata'],
Expand All @@ -60,7 +61,7 @@ def listen_for_exam_attempt_errored(sender, signal, **kwargs): # pylint: disabl
"""
get_producer().send(
signal=EXAM_ATTEMPT_ERRORED,
topic='exam-attempt-errored',
topic=getattr(settings, 'EXAM_ATTEMPT_EVENTS_KAFKA_TOPIC_NAME', ''),
event_key_field='exam_attempt.course_key',
event_data={'exam_attempt': kwargs['exam_attempt']},
event_metadata=kwargs['metadata'],
Expand Down
3 changes: 3 additions & 0 deletions edx_exams/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,3 +277,6 @@ def root(*path_fragments):
LEARNING_MICROFRONTEND_URL = None

EXAMS_DASHBOARD_MFE_URL = None

# Event Bus Settings
EXAM_ATTEMPT_EVENTS_KAFKA_TOPIC_NAME = 'learning-exam-attempt-lifecycle'

0 comments on commit e8db7e0

Please sign in to comment.