summaryrefslogtreecommitdiff
path: root/kafka/consumer/simple.py
diff options
context:
space:
mode:
authorDana Powers <dana.powers@rd.io>2016-01-12 16:52:30 -0800
committerDana Powers <dana.powers@rd.io>2016-01-12 16:52:30 -0800
commit4079a582b07989e683bcb2d87f6d522ed61a4f66 (patch)
treedeba002c4b9ce6407fe8160afceccc25d9660b09 /kafka/consumer/simple.py
parentdcad3fea16028ae00f64baa981553b62666b15fb (diff)
downloadkafka-python-deprecation_warnings.tar.gz
Add DeprecationWarnings to legacy KafkaClient, Simple/MultiProcess/Consumer, and KafkaConnectiondeprecation_warnings
Diffstat (limited to 'kafka/consumer/simple.py')
-rw-r--r--kafka/consumer/simple.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/kafka/consumer/simple.py b/kafka/consumer/simple.py
index 29eb480..77c99b1 100644
--- a/kafka/consumer/simple.py
+++ b/kafka/consumer/simple.py
@@ -7,6 +7,7 @@ except ImportError:
import logging
import sys
import time
+import warnings
import six
from six.moves import queue
@@ -40,6 +41,8 @@ class FetchContext(object):
Class for managing the state of a consumer during fetch
"""
def __init__(self, consumer, block, timeout):
+ warnings.warn('deprecated - this class will be removed in a future'
+ ' release', DeprecationWarning)
self.consumer = consumer
self.block = block
@@ -116,6 +119,9 @@ class SimpleConsumer(Consumer):
max_buffer_size=MAX_FETCH_BUFFER_SIZE_BYTES,
iter_timeout=None,
auto_offset_reset='largest'):
+ warnings.warn('deprecated - this class will be removed in a future'
+ ' release. Use KafkaConsumer instead.',
+ DeprecationWarning)
super(SimpleConsumer, self).__init__(
client, group, topic,
partitions=partitions,