Skip to content

Commit

Permalink
fixup!: use new method
Browse files Browse the repository at this point in the history
  • Loading branch information
Rebecca Graber committed Jan 25, 2024
1 parent 6cebb03 commit db4a5ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
5 changes: 2 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ Change Log
Unreleased
**********

[5.6.0] - 2024-01-24
[5.6.0] - 2024-01-25
********************
Changed
=======
* Added configurable client.id to base configuration. Derives from new setting EVENT_BUS_SERVICE_NAME

* Added client.id to base configuration.

[5.5.0] - 2023-09-21
********************
Expand Down
10 changes: 3 additions & 7 deletions edx_event_bus_kafka/internal/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
from django.dispatch import receiver
from django.test.signals import setting_changed

from openedx_events.data import get_service_name

# See https://github.com/openedx/event-bus-kafka/blob/main/docs/decisions/0005-optional-import-of-confluent-kafka.rst
try:
import confluent_kafka
Expand Down Expand Up @@ -109,13 +111,7 @@ def load_common_settings() -> Optional[dict]:
'sasl.password': secret,
})

# .. setting_name: EVENT_BUS_SERVICE_NAME
# .. setting_default: None
# .. setting_description: Identifier for the producing/consuming service. If not set
# Kafka will use 'rdkafka' as the identifier. For example, if using the event bus in course-discovery,
# this setting should be set to "course-discovery" so it's clear in the Kafka stream where events are coming from.
# Kafka calls this the "client id."
client_id = getattr(settings, 'EVENT_BUS_SERVICE_NAME', None)
client_id = get_service_name()
if client_id:
base_settings.update({
'client.id': client_id
Expand Down

0 comments on commit db4a5ac

Please sign in to comment.