diff options
author | David Arthur <mumrah@gmail.com> | 2013-06-13 06:03:36 -0700 |
---|---|---|
committer | David Arthur <mumrah@gmail.com> | 2013-06-13 06:03:36 -0700 |
commit | 883eed1f8ce1af37c621ad6ec89dc993694fd29b (patch) | |
tree | 1af748932ca319bbe040d3aa1f73604701d5f2ed /kafka/client.py | |
parent | 77b8301e253774e09d13ff6b7c132fd51e6d9091 (diff) | |
parent | 0723cf8beca7ff6433c79ca04ad1945b00eea6d1 (diff) | |
download | kafka-python-883eed1f8ce1af37c621ad6ec89dc993694fd29b.tar.gz |
Merge pull request #32 from mahendra/keyed
Implement support for keyed messages
Diffstat (limited to 'kafka/client.py')
-rw-r--r-- | kafka/client.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kafka/client.py b/kafka/client.py index 5595d49..1146798 100644 --- a/kafka/client.py +++ b/kafka/client.py @@ -73,7 +73,12 @@ class KafkaClient(object): self.brokers.update(brokers) self.topics_to_brokers = {} + for topic, partitions in topics.items(): + # Clear the list once before we add it. This removes stale entries + # and avoids duplicates + self.topic_partitions.pop(topic, None) + if not partitions: log.info("Partition is unassigned, delay for 1s and retry") time.sleep(1) |