diff options
author | Dana Powers <dana.powers@rd.io> | 2016-01-03 16:12:22 -0800 |
---|---|---|
committer | Dana Powers <dana.powers@rd.io> | 2016-01-03 16:12:22 -0800 |
commit | df75751238f2ccc731d9881c92dfcc524c57aeaf (patch) | |
tree | afdb94f4168e6cb4013e6cea481e099edc947464 | |
parent | abdbc6ca2785a5646ee9dccf4f5ccf700da5f648 (diff) | |
download | kafka-python-df75751238f2ccc731d9881c92dfcc524c57aeaf.tar.gz |
Add deprecated methods to KafkaConsumer w/ notes on alternatives
-rw-r--r-- | kafka/consumer/group.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/kafka/consumer/group.py b/kafka/consumer/group.py index 0293b4c..bd9d03d 100644 --- a/kafka/consumer/group.py +++ b/kafka/consumer/group.py @@ -651,3 +651,34 @@ class KafkaConsumer(six.Iterator): except StopIteration: self._iterator = None raise + + # old KafkaConsumer methods are deprecated + def configure(self, **configs): + """DEPRECATED -- initialize a new consumer""" + raise NotImplementedError( + 'deprecated -- initialize a new consumer') + + def set_topic_partitions(self, *topics): + """DEPRECATED -- use subscribe() or assign()""" + raise NotImplementedError( + 'deprecated -- use subscribe() or assign()') + + def fetch_messages(self): + """DEPRECATED -- use poll() or iterator interface""" + raise NotImplementedError( + 'deprecated -- use poll() or iterator interface') + + def get_partition_offsets(self, topic, partition, + request_time_ms, max_num_offsets): + """DEPRECATED -- send OffsetRequest with KafkaClient""" + raise NotImplementedError( + 'deprecated -- send an OffsetRequest with KafkaClient') + + def offsets(self, group=None): + """DEPRECATED -- use committed(partition)""" + raise NotImplementedError('deprecated -- use committed(partition)') + + def task_done(self, message): + """DEPRECATED -- commit manually if needed""" + raise NotImplementedError( + 'deprecated -- commit offsets manually if needed') |