diff options
author | Dana Powers <dana.powers@gmail.com> | 2017-06-18 23:49:50 -0700 |
---|---|---|
committer | Dana Powers <dana.powers@gmail.com> | 2017-06-18 23:49:50 -0700 |
commit | 12d740ed0d1eb19a87d9e1b0172549e6279d1cba (patch) | |
tree | a3388db077e289ad4b6cdff4dec3ad74b87d2af5 | |
parent | a11b63d81acc2ae07b3bf4f5dd7e438918d3eadb (diff) | |
download | kafka-python-12d740ed0d1eb19a87d9e1b0172549e6279d1cba.tar.gz |
Update KafkaConsumer / KafkaProducer docstrings and defaults
-rw-r--r-- | kafka/consumer/group.py | 14 | ||||
-rw-r--r-- | kafka/producer/kafka.py | 14 |
2 files changed, 18 insertions, 10 deletions
diff --git a/kafka/consumer/group.py b/kafka/consumer/group.py index 2512139..6adb154 100644 --- a/kafka/consumer/group.py +++ b/kafka/consumer/group.py @@ -91,10 +91,14 @@ class KafkaConsumer(six.Iterator): reconnect_backoff_ms (int): The amount of time in milliseconds to wait before attempting to reconnect to a given host. Default: 50. - reconnect_backoff_max (int): If higher than reconnect_backoff_ms, - node reconnect backoff will increase on each consecutive failure - up to this maximum. The actual backoff is chosen randomly from - an exponentially increasing range. Default: 60000. + reconnect_backoff_max_ms (int): The maximum amount of time in + milliseconds to wait when reconnecting to a broker that has + repeatedly failed to connect. If provided, the backoff per host + will increase exponentially for each consecutive connection + failure, up to this maximum. To avoid connection storms, a + randomization factor of 0.2 will be applied to the backoff + resulting in a random range between 20% below and 20% above + the computed value. Default: 1000. max_in_flight_requests_per_connection (int): Requests are pipelined to kafka brokers up to this number of maximum requests per broker connection. Default: 5. @@ -234,7 +238,7 @@ class KafkaConsumer(six.Iterator): 'request_timeout_ms': 40 * 1000, 'retry_backoff_ms': 100, 'reconnect_backoff_ms': 50, - 'reconnect_backoff_max': 60000, + 'reconnect_backoff_max_ms': 1000, 'max_in_flight_requests_per_connection': 5, 'auto_offset_reset': 'latest', 'enable_auto_commit': True, diff --git a/kafka/producer/kafka.py b/kafka/producer/kafka.py index 482628d..1f78c89 100644 --- a/kafka/producer/kafka.py +++ b/kafka/producer/kafka.py @@ -199,10 +199,14 @@ class KafkaProducer(object): reconnect_backoff_ms (int): The amount of time in milliseconds to wait before attempting to reconnect to a given host. Default: 50. - reconnect_backoff_max (int): If higher than reconnect_backoff_ms, - node reconnect backoff will increase on each consecutive failure - up to this maximum. The actual backoff is chosen randomly from - an exponentially increasing range. Default: 60000. + reconnect_backoff_max_ms (int): The maximum amount of time in + milliseconds to wait when reconnecting to a broker that has + repeatedly failed to connect. If provided, the backoff per host + will increase exponentially for each consecutive connection + failure, up to this maximum. To avoid connection storms, a + randomization factor of 0.2 will be applied to the backoff + resulting in a random range between 20% below and 20% above + the computed value. Default: 1000. max_in_flight_requests_per_connection (int): Requests are pipelined to kafka brokers up to this number of maximum requests per broker connection. Default: 5. @@ -280,7 +284,7 @@ class KafkaProducer(object): 'send_buffer_bytes': None, 'socket_options': [(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)], 'reconnect_backoff_ms': 50, - 'reconnect_backoff_max': 60000, + 'reconnect_backoff_max': 1000, 'max_in_flight_requests_per_connection': 5, 'security_protocol': 'PLAINTEXT', 'ssl_context': None, |