What is the delay time between each poll

不羁的心 提交于 2021-01-29 16:06:25

问题


In kafka documentation i'm trying to understand this property max.poll.interval.ms

The maximum delay between invocations of poll() when using consumer group management. This places an upper bound on the amount of time that the consumer can be idle before fetching more records. If poll() is not called before expiration of this timeout, then the consumer is considered failed and the group will rebalance in order to reassign the partitions to another member.

This mean each poll will happen before the poll-time-out by default it is 5 minutes. So my question is exactly how much time consumer thread takes between two consecutive polls?

For example: Consumer Thread 1

First poll--> with 100 records --> process 100 records (took 1 minute) --> consumer submitted offset

Second poll--> with 100 records --> process 100 records (took 1 minute) --> consumer submitted offset

Does consumer take time between first and second poll? if yes, why? and how can we change that time ( assume this when topic has huge data)


回答1:


It's not clear what you mean by "take time between"; if you are talking about the spring-kafka listener container, there is no wait or sleep, if that's what you mean.

The consumer is polled immediately after the offsets are committed.

So, max.poll.interval.ms must be large enough for your listener to process max.poll.records (plus some extra, just in case).

But, no, there are no delays added between polls, just the time it takes the listener to handle the results of the poll.



来源:https://stackoverflow.com/questions/52655108/what-is-the-delay-time-between-each-poll

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!