diff options
author | Taras Voinarovskyi <voyn1991@gmail.com> | 2017-03-07 00:59:26 +0200 |
---|---|---|
committer | Dana Powers <dana.powers@gmail.com> | 2017-03-06 14:59:26 -0800 |
commit | 9c19ea7cbe163b0c434ce9dd9c8c42471027cce5 (patch) | |
tree | 8802dfc07e053279d18be591af11a1a4edf4988c /kafka/consumer/group.py | |
parent | ff6f7bf085b912090b436da1c99f6f8f4cf66f94 (diff) | |
download | kafka-python-9c19ea7cbe163b0c434ce9dd9c8c42471027cce5.tar.gz |
Added `max_bytes` option and FetchRequest_v3 usage. (#962)
* Added `max_bytes` option and FetchRequest_v3 usage.
* Add checks for versions above 0.10 based on ApiVersionResponse
Diffstat (limited to 'kafka/consumer/group.py')
-rw-r--r-- | kafka/consumer/group.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/kafka/consumer/group.py b/kafka/consumer/group.py index 89c946f..1addcc2 100644 --- a/kafka/consumer/group.py +++ b/kafka/consumer/group.py @@ -65,6 +65,14 @@ class KafkaConsumer(six.Iterator): the server will block before answering the fetch request if there isn't sufficient data to immediately satisfy the requirement given by fetch_min_bytes. Default: 500. + fetch_max_bytes (int): The maximum amount of data the server should + return for a fetch request. This is not an absolute maximum, if the + first message in the first non-empty partition of the fetch is + larger than this value, the message will still be returned to + ensure that the consumer can make progress. NOTE: consumer performs + fetches to multiple brokers in parallel so memory usage will depend + on the number of brokers containing partitions for the topic. + Supported Kafka version >= 0.10.1.0. Default: 52428800 (50 Mb). max_partition_fetch_bytes (int): The maximum amount of data per-partition the server will return. The maximum total memory used for a request = #partitions * max_partition_fetch_bytes. @@ -212,6 +220,7 @@ class KafkaConsumer(six.Iterator): 'value_deserializer': None, 'fetch_max_wait_ms': 500, 'fetch_min_bytes': 1, + 'fetch_max_bytes': 52428800, 'max_partition_fetch_bytes': 1 * 1024 * 1024, 'request_timeout_ms': 40 * 1000, 'retry_backoff_ms': 100, |