# Kafka input plugin

**URL:** <https://discuss.elastic.co/t/kafka-input-plugin/258303>\
**Category:** Logstash\
**Created:** [December 10, 2020, 3:53pm UTC](https://discuss.elastic.co/t/kafka-input-plugin/258303 "2020-12-10T15:53:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samuel\_Delepiere](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samuel_delepiere/32/75345_2.png) [@Samuel\_Delepiere](https://discuss.elastic.co/u/Samuel_Delepiere)\
**Post date:** [December 10, 2020, 3:53pm UTC](https://discuss.elastic.co/t/kafka-input-plugin/258303/1 "2020-12-10T15:53:18Z")

</div>

The documentation does not really make sense when it comes to poll\_timeout\_ms and fetch\_max\_wait\_ms.

According to the documentation:

- fetch\_max\_wait\_ms has a default value of 500ms
- poll\_timeout\_ms has a default value of 100ms.

Yet it says that fetch\_max\_wait\_ms should be less than or equal to poll\_timeout\_ms.

Additionally setting poll\_timeout\_ms does not seem to do anything. I can't see a difference in the properties of the kafka consumer when changing this value.

Could you provide some explanations please?

Thanks.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [December 10, 2020, 5:17pm UTC](https://discuss.elastic.co/t/kafka-input-plugin/258303/2 "2020-12-10T17:17:54Z")

</div>

I cannot see any reason for fetch\_max\_wait\_ms to be constrained to be smaller than poll\_timeout\_ms.

poll\_timeout\_ms is not a property of the kafka consumer itself, it is used in the [calling code](https://github.com/logstash-plugins/logstash-input-kafka/blob/66e6a26ce97b29beb03b4196316eb84852887d52/lib/logstash/inputs/kafka.rb#L255). It determines how long each call to consumer.poll waits to get data. The default value is set in the plugin.

fetch\_max\_wait\_ms is a property of the consumer and the default value is set by kafka. [This SO question](https://stackoverflow.com/questions/58697750/fetch-max-wait-ms-vs-parameter-to-poll-method) explicitly covers the case where fetch\_max\_wait\_ms is larger than poll\_timeout\_ms. There will be multiple poll calls until fetch\_max\_wait\_ms expires and then the server will return whatever it has even if fetch\_min\_bytes has not been exceeded. Given that the default fetch\_min\_bytes is 1, it appears to me that the value of fetch\_max\_wait\_ms does not usually matter.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 7, 2021, 5:18pm UTC](https://discuss.elastic.co/t/kafka-input-plugin/258303/3 "2021-01-07T17:18:12Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
