summaryrefslogtreecommitdiff
path: root/kafka/client.py
diff options
context:
space:
mode:
authorcharsyam <charsyam@naver.com>2017-03-03 07:15:01 +0900
committerDana Powers <dana.powers@gmail.com>2017-03-02 14:15:01 -0800
commit3a630f2f886d9182bc6fe593d3659b0f3986fb4b (patch)
tree6b2f539a1227065cc7dabd1e06acc74c10e49cf3 /kafka/client.py
parenta22ea165649b3510d770243f6f3809d598cb4f81 (diff)
downloadkafka-python-3a630f2f886d9182bc6fe593d3659b0f3986fb4b.tar.gz
Add send_list_offset_request for searching offset by timestamp (#1001)
Diffstat (limited to 'kafka/client.py')
-rw-r--r--kafka/client.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/kafka/client.py b/kafka/client.py
index ff0169b..9df5bd9 100644
--- a/kafka/client.py
+++ b/kafka/client.py
@@ -686,6 +686,16 @@ class SimpleClient(object):
return [resp if not callback else callback(resp) for resp in resps
if not fail_on_error or not self._raise_on_response_error(resp)]
+ def send_list_offset_request(self, payloads=[], fail_on_error=True,
+ callback=None):
+ resps = self._send_broker_aware_request(
+ payloads,
+ KafkaProtocol.encode_list_offset_request,
+ KafkaProtocol.decode_list_offset_response)
+
+ return [resp if not callback else callback(resp) for resp in resps
+ if not fail_on_error or not self._raise_on_response_error(resp)]
+
def send_offset_commit_request(self, group, payloads=[],
fail_on_error=True, callback=None):
encoder = functools.partial(KafkaProtocol.encode_offset_commit_request,