summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Shaw <jordan@pubnub.com>2014-12-15 15:56:02 -0800
committerJordan Shaw <jordan@pubnub.com>2014-12-15 15:56:12 -0800
commitd14552580c4d113faf9d74ce190f14774e181a9b (patch)
tree01fad33e7aa8d74a39654c688b5b6d8bace80528
parent02124907ff2ddf26cf7a09564c3d7ded95822349 (diff)
downloadkafka-python-d14552580c4d113faf9d74ce190f14774e181a9b.tar.gz
added a send_messages api to KeyedProducer
Signed-off-by: Jordan Shaw <jordan@pubnub.com>
-rw-r--r--kafka/producer/keyed.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/kafka/producer/keyed.py b/kafka/producer/keyed.py
index 473f70a..68c70d9 100644
--- a/kafka/producer/keyed.py
+++ b/kafka/producer/keyed.py
@@ -54,6 +54,10 @@ class KeyedProducer(Producer):
partitioner = self.partitioners[topic]
return partitioner.partition(key, self.client.get_partition_ids_for_topic(topic))
+ def send_messages(self,topic,key,*msg):
+ partition = self._next_partition(topic, key)
+ return self._send_messages(topic, partition, *msg,key=key)
+
def send(self, topic, key, msg):
partition = self._next_partition(topic, key)
return self._send_messages(topic, partition, msg, key=key)