diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 805d91f..0b020c5 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -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 ******************** diff --git a/edx_event_bus_kafka/internal/config.py b/edx_event_bus_kafka/internal/config.py index cf95621..d29e9d6 100644 --- a/edx_event_bus_kafka/internal/config.py +++ b/edx_event_bus_kafka/internal/config.py @@ -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 @@ -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