Skip to content

Commit

Permalink
Merge pull request #68 from lpsinger/update-comments
Browse files Browse the repository at this point in the history
Update doc strings and comments for confluent-kafka workarounds
  • Loading branch information
cnweaver authored May 22, 2023
2 parents 16dd943 + b9db15a commit 684fa08
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion adc/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self, conf: 'ConsumerConfig') -> None:
self.logger = logging.getLogger("adc-streaming.consumer")
self.conf = conf
self._consumer = confluent_kafka.Consumer(conf._to_confluent_kafka())
# Workaround for https://github.com/edenhill/librdkafka/issues/3871.
# Workaround for https://github.com/confluentinc/librdkafka/issues/3753#issuecomment-1058272987.
# FIXME: Remove once fixed upstream, or on removal of oauth_cb.
self._consumer.poll(0)
self._stop_event = threading.Event()
Expand Down
8 changes: 5 additions & 3 deletions adc/oidc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ def set_oauth_cb(config):
"""Implement client support for KIP-768 OpenID Connect.
Apache Kafka 3.1.0 supports authentication using OpenID Client Credentials.
Native support for Python is coming in the next release of librdkafka
(version 1.9.0). Meanwhile, this is a pure Python implementation of the
refresh token callback.
Native support for Python is still incomplete due to this issue:
https://github.com/confluentinc/librdkafka/issues/3751
Meanwhile, this is a pure Python implementation of the refresh token
callback.
"""
if config.pop('sasl.oauthbearer.method', None) != 'oidc':
return
Expand Down
2 changes: 1 addition & 1 deletion adc/producer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self, conf: 'ProducerConfig') -> None:
self.conf = conf
self.logger.debug(f"connecting to producer with config {conf._to_confluent_kafka()}")
self._producer = confluent_kafka.Producer(conf._to_confluent_kafka())
# Workaround for https://github.com/edenhill/librdkafka/issues/3871.
# Workaround for https://github.com/confluentinc/librdkafka/issues/3753#issuecomment-1058272987.
# FIXME: Remove once fixed upstream, or on removal of oauth_cb.
self._producer.poll(0)

Expand Down

0 comments on commit 684fa08

Please sign in to comment.