From 9c643e0218b7471fa7f8fd7cd650710c9ba35184 Mon Sep 17 00:00:00 2001 From: Alex Couture-Beil Date: Fri, 9 Jan 2015 10:54:31 -0800 Subject: Randomize start by default for SimpleProducer random_start=False is dangerous. Any client that initializes a SimpleProducer and performs only a single publish batch will always go to partition 0. A common use-case for this is command line utilities, or web-servers which are unable to cache the SimpleProducer instance between calls. --- kafka/producer/simple.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kafka/producer/simple.py b/kafka/producer/simple.py index a10fa8c..401b79b 100644 --- a/kafka/producer/simple.py +++ b/kafka/producer/simple.py @@ -42,7 +42,7 @@ class SimpleProducer(Producer): batch_send=False, batch_send_every_n=BATCH_SEND_MSG_COUNT, batch_send_every_t=BATCH_SEND_DEFAULT_INTERVAL, - random_start=False): + random_start=True): self.partition_cycles = {} self.random_start = random_start super(SimpleProducer, self).__init__(client, async, req_acks, -- cgit v1.2.1