Skip to content

Commit c2eccd5

Browse files
committed
Merge pull request #446 from zackdever/consumer-class-configs
Set default config on consumer class to support subclass config changes.
2 parents da21744 + e59e6cf commit c2eccd5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

kafka/consumer/kafka.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353

5454
class KafkaConsumer(object):
5555
"""A simpler kafka consumer"""
56+
DEFAULT_CONFIG = deepcopy(DEFAULT_CONSUMER_CONFIG)
5657

5758
def __init__(self, *topics, **configs):
5859
self.configure(**configs)
@@ -111,8 +112,8 @@ def configure(self, **configs):
111112
"""
112113
configs = self._deprecate_configs(**configs)
113114
self._config = {}
114-
for key in DEFAULT_CONSUMER_CONFIG:
115-
self._config[key] = configs.pop(key, DEFAULT_CONSUMER_CONFIG[key])
115+
for key in self.DEFAULT_CONFIG:
116+
self._config[key] = configs.pop(key, self.DEFAULT_CONFIG[key])
116117

117118
if configs:
118119
raise KafkaConfigurationError('Unknown configuration key(s): ' +

0 commit comments

Comments
 (0)