Skip to content

Commit

Permalink
fix: add signal back as optional param (#163)
Browse files Browse the repository at this point in the history
Re-add the 'signal' parameter to the KafkaEventConsumer, as is expected by the EventBusConsumer API.
  • Loading branch information
Rebecca Graber authored May 11, 2023
1 parent 1f3896a commit a89a2fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ Change Log
Unreleased
**********

[4.0.1] - 2023-05-10
********************
Fixed
=====
* Added ``signal`` back as an argument when creating a consumer for compatibility with the openedx-events API

[4.0.0] - 2023-05-10
********************
Changed
Expand Down
2 changes: 1 addition & 1 deletion edx_event_bus_kafka/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
from edx_event_bus_kafka.internal.consumer import KafkaEventConsumer
from edx_event_bus_kafka.internal.producer import KafkaEventProducer, create_producer

__version__ = '4.0.0'
__version__ = '4.0.1'
4 changes: 2 additions & 2 deletions edx_event_bus_kafka/internal/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ class KafkaEventConsumer(EventBusConsumer):
Attributes:
topic: Topic to consume (without environment prefix).
group_id: Consumer group id.
signal: Type of signal to emit from consumed messages.
signal: DEPRECATED Type of signal to emit from consumed messages. Will be removed in a future version
consumer: Actual kafka consumer instance.
offset_time: The timestamp (in ISO format) that we would like to reset the consumers to. If this is used, the
consumers will only reset the offsets of the topic but will not actually consume and process any messages.
"""

def __init__(self, topic, group_id, offset_time=None):
def __init__(self, topic, group_id, signal=None, offset_time=None): # pylint: disable=unused-argument
if confluent_kafka is None: # pragma: no cover
raise Exception('Library confluent-kafka not available. Cannot create event consumer.')

Expand Down

0 comments on commit a89a2fb

Please sign in to comment.