From 77ea87c1e64e9a0b051f0749e4c7fc1851aa26cc Mon Sep 17 00:00:00 2001 From: michaelroytman Date: Thu, 28 Sep 2023 16:48:19 -0400 Subject: [PATCH] feat: add event bus and Kafka Django settings --- edx_exams/settings/devstack.py | 12 ++++++++++++ edx_exams/settings/local.py | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/edx_exams/settings/devstack.py b/edx_exams/settings/devstack.py index 8208b6c3..2da411bd 100644 --- a/edx_exams/settings/devstack.py +++ b/edx_exams/settings/devstack.py @@ -52,3 +52,15 @@ }) LMS_ROOT_URL = 'http://edx.devstack.lms:18000' + +EVENT_BUS_PRODUCER = 'edx_event_bus_kafka.create_producer' +EVENT_BUS_CONSUMER = 'edx_event_bus_kafka.KafkaEventConsumer' +EVENT_BUS_KAFKA_SCHEMA_REGISTRY_URL = 'http://edx.devstack.schema-registry:8081' +EVENT_BUS_KAFKA_BOOTSTRAP_SERVERS = 'edx.devstack.kafka:29092' +EVENT_BUS_TOPIC_PREFIX = 'dev' + +# The EVENT_BUS_PRODUCER_CONFIG Django setting introduced in openedx-events 8.6.0 does not work properly. +# In order to unblock development, EVENT_BUS_PRODUCER_CONFIG should be set to the empty object. Signal handlers +# should be added as before (i.e. versions <8.6.0). +# Once openedx-events 8.6.0 is corrected, this Django setting should be set. +EVENT_BUS_PRODUCER_CONFIG = {} diff --git a/edx_exams/settings/local.py b/edx_exams/settings/local.py index 22d5cabd..b615372c 100644 --- a/edx_exams/settings/local.py +++ b/edx_exams/settings/local.py @@ -134,3 +134,15 @@ # Lastly, see if the developer has any local overrides. if os.path.isfile(join(dirname(abspath(__file__)), 'private.py')): from .private import * # pylint: disable=import-error + +EVENT_BUS_PRODUCER = 'edx_event_bus_kafka.create_producer' +EVENT_BUS_CONSUMER = 'edx_event_bus_kafka.KafkaEventConsumer' +EVENT_BUS_KAFKA_SCHEMA_REGISTRY_URL = 'http://edx.devstack.schema-registry:8081' +EVENT_BUS_KAFKA_BOOTSTRAP_SERVERS = 'edx.devstack.kafka:29092' +EVENT_BUS_TOPIC_PREFIX = 'dev' + +# The EVENT_BUS_PRODUCER_CONFIG Django setting introduced in openedx-events 8.6.0 does not work properly. +# In order to unblock development, EVENT_BUS_PRODUCER_CONFIG should be set to the empty object. Signal handlers +# should be added as before (i.e. versions <8.6.0). +# Once openedx-events 8.6.0 is corrected, this Django setting should be set. +EVENT_BUS_PRODUCER_CONFIG = {} \ No newline at end of file