summaryrefslogtreecommitdiff
path: root/kafka/producer.py
diff options
context:
space:
mode:
authorOmar <omar.ghishan@rd.io>2014-01-13 13:52:02 -0800
committerOmar <omar.ghishan@rd.io>2014-01-13 13:52:02 -0800
commit87c7f9dedfc008e3fff7a010cc4e708eeec5bebe (patch)
treec55c3c5fea1fab6eef77f5213909ed2c2f8acc92 /kafka/producer.py
parent354fcdbdd9b34b3454b964e6dc0d4a746744bbcd (diff)
parenta0c7141e2cc7399a9472a8169ea5f730f0407386 (diff)
downloadkafka-python-87c7f9dedfc008e3fff7a010cc4e708eeec5bebe.tar.gz
Merge pull request #88 from rdiomar/rdiomar_changes
Various changes/fixes, including: * Allow customizing socket timeouts * Read the correct number of bytes from kafka * Guarantee reading the expected number of bytes from the socket every time * Remove bufsize from client and conn * SimpleConsumer flow changes * Fix some error handling * Add optional upper limit to consumer fetch buffer size * Add and fix unit and integration tests
Diffstat (limited to 'kafka/producer.py')
-rw-r--r--kafka/producer.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/kafka/producer.py b/kafka/producer.py
index a82d99b..5aead43 100644
--- a/kafka/producer.py
+++ b/kafka/producer.py
@@ -69,7 +69,7 @@ def _send_upstream(topic, queue, client, batch_time, batch_size,
client.send_produce_request(reqs,
acks=req_acks,
timeout=ack_timeout)
- except Exception as exp:
+ except Exception:
log.exception("Unable to send message")
@@ -146,9 +146,9 @@ class Producer(object):
try:
resp = self.client.send_produce_request([req], acks=self.req_acks,
timeout=self.ack_timeout)
- except Exception as e:
+ except Exception:
log.exception("Unable to send messages")
- raise e
+ raise
return resp
def stop(self, timeout=1):