Skip to content

Commit 19d403c

Browse files
author
Dana Powers
committed
Add metadata_max_age_ms and retry_backoff_ms options to async client
1 parent e080c6b commit 19d403c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

kafka/client_async.py

+8
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ class KafkaClient(object):
4040
'max_in_flight_requests_per_connection': 5,
4141
'receive_buffer_bytes': 32768,
4242
'send_buffer_bytes': 131072,
43+
'retry_backoff_ms': 100,
44+
'metadata_max_age_ms': 300000,
4345
}
4446

4547
def __init__(self, **configs):
@@ -69,6 +71,12 @@ def __init__(self, **configs):
6971
(SO_SNDBUF) to use when sending data. Default: 131072
7072
receive_buffer_bytes (int): The size of the TCP receive buffer
7173
(SO_RCVBUF) to use when reading data. Default: 32768
74+
metadata_max_age_ms (int): The period of time in milliseconds after
75+
which we force a refresh of metadata even if we haven't seen any
76+
partition leadership changes to proactively discover any new
77+
brokers or partitions. Default: 300000
78+
retry_backoff_ms (int): Milliseconds to backoff when retrying on
79+
errors. Default: 100.
7280
"""
7381
self.config = copy.copy(self.DEFAULT_CONFIG)
7482
for key in self.config:

0 commit comments

Comments
 (0)