Skip to content

Commit

Permalink
fix: remove local Kafka settings
Browse files Browse the repository at this point in the history
This commit removes Django settings from the local settings file, used by the local application server, related to setting up the Kafka implementation of the event bus. This is because the event bus does not work outside of a Docker container. This is because the event bus is run through the devstack networking layer, which is inaccessible by the local application server.
  • Loading branch information
MichaelRoytman committed Oct 4, 2023
1 parent 90a7d44 commit 2e39c7f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions edx_exams/settings/devstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@

LMS_ROOT_URL = 'http://edx.devstack.lms:18000'

# EVENT BUS

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'
Expand Down
12 changes: 10 additions & 2 deletions edx_exams/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,19 @@
if os.path.isfile(join(dirname(abspath(__file__)), 'private.py')):
from .private import * # pylint: disable=import-error

# EVENT BUS
# Below are Django settings related to setting up the Open edX event bus.
# Because the event bus requires a Docker based networking layer, as included in devstack, the event bus does not work
# outside of a Docker container. Therefore, the settings related to networking are set to None, because this file is
# used for the local application server. However, because these local Django settings are also used by Tutor, we include
# sensible values for non-network related settings. Tutor users can override these settings when setting up the event
# bus, including the network-related settings.

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'
EVENT_BUS_KAFKA_SCHEMA_REGISTRY_URL = None
EVENT_BUS_KAFKA_BOOTSTRAP_SERVERS = None

# 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
Expand Down

0 comments on commit 2e39c7f

Please sign in to comment.