summaryrefslogtreecommitdiff
path: root/kafka/conn.py
diff options
context:
space:
mode:
authorNing Xie <andy.xning@gmail.com>2018-08-31 21:01:46 +0800
committerDana Powers <dana.powers@gmail.com>2018-08-31 06:01:46 -0700
commita7d3063d5fa1c3cb2a76c16231bb3028a6f8cde9 (patch)
tree41acc8d3722d9e15c74b1ae8a7264250394bf9bc /kafka/conn.py
parent9ac3cb1ec220ff9968a8b003b02e98dd11cc486b (diff)
downloadkafka-python-a7d3063d5fa1c3cb2a76c16231bb3028a6f8cde9.tar.gz
add support for smaller topic metadata fetch during bootstrap (#1541)
Diffstat (limited to 'kafka/conn.py')
-rw-r--r--kafka/conn.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/kafka/conn.py b/kafka/conn.py
index a2d5ee6..122297b 100644
--- a/kafka/conn.py
+++ b/kafka/conn.py
@@ -892,7 +892,7 @@ class BrokerConnection(object):
# so if all else fails, choose that
return (0, 10, 0)
- def check_version(self, timeout=2, strict=False):
+ def check_version(self, timeout=2, strict=False, topics=[]):
"""Attempt to guess the broker version.
Note: This is a blocking call.
@@ -925,7 +925,7 @@ class BrokerConnection(object):
((0, 9), ListGroupsRequest[0]()),
((0, 8, 2), GroupCoordinatorRequest[0]('kafka-python-default-group')),
((0, 8, 1), OffsetFetchRequest[0]('kafka-python-default-group', [])),
- ((0, 8, 0), MetadataRequest[0]([])),
+ ((0, 8, 0), MetadataRequest[0](topics)),
]
for version, request in test_cases:
@@ -941,7 +941,7 @@ class BrokerConnection(object):
# the attempt to write to a disconnected socket should
# immediately fail and allow us to infer that the prior
# request was unrecognized
- mr = self.send(MetadataRequest[0]([]))
+ mr = self.send(MetadataRequest[0](topics))
selector = self.config['selector']()
selector.register(self._sock, selectors.EVENT_READ)