每次轮询之间的延迟时间是多少
What is the delay time between each poll
在 kafka 文档中我试图理解这个 属性 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.
这意味着每个轮询将在 poll-time-out
之前发生,默认情况下是 5 分钟。所以我的问题是消费者线程在两次连续的轮询之间究竟需要多少时间?
例如:消费者线程 1
第一次投票 --> 有 100 条记录
--> 处理 100 条记录(用时 1 分钟)
--> 消费者提交的偏移量
第二次投票 --> 有 100 条记录
--> 处理 100 条记录(用时 1 分钟)
--> 消费者提交的偏移量
消费者在第一次和第二次投票之间需要时间吗?如果是,为什么?以及我们如何改变那个时间(当主题有大量数据时假设这个)
不清楚你说的"take time between"是什么意思;如果你在谈论 spring-kafka 侦听器容器,则没有等待或睡眠,如果那是你的意思。
提交偏移量后立即轮询消费者。
因此,max.poll.interval.ms
必须足够大以供您的侦听器处理 max.poll.records
(加上一些额外的,以防万一)。
但是,不,轮询之间没有添加延迟,只是监听器处理轮询结果所花费的时间。
在 kafka 文档中我试图理解这个 属性 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.
这意味着每个轮询将在 poll-time-out
之前发生,默认情况下是 5 分钟。所以我的问题是消费者线程在两次连续的轮询之间究竟需要多少时间?
例如:消费者线程 1
第一次投票 --> 有 100 条记录 --> 处理 100 条记录(用时 1 分钟) --> 消费者提交的偏移量
第二次投票 --> 有 100 条记录 --> 处理 100 条记录(用时 1 分钟) --> 消费者提交的偏移量
消费者在第一次和第二次投票之间需要时间吗?如果是,为什么?以及我们如何改变那个时间(当主题有大量数据时假设这个)
不清楚你说的"take time between"是什么意思;如果你在谈论 spring-kafka 侦听器容器,则没有等待或睡眠,如果那是你的意思。
提交偏移量后立即轮询消费者。
因此,max.poll.interval.ms
必须足够大以供您的侦听器处理 max.poll.records
(加上一些额外的,以防万一)。
但是,不,轮询之间没有添加延迟,只是监听器处理轮询结果所花费的时间。