使用 spring retryable 超过 max.poll.interval.ms 竟然没有被移出 consumer group

2021-05-23 23:36:52 +08:00
 hackingwu

@Retryable( maxAttempts = 99, backoff = @Backoff(delay = 1000L, multiplier = 1)) @KafkaListener(id="tc1", containerFactory = "tc1", topics = "s") public void consume(ConsumerRecord<String, String> record, Acknowledgment acknowledgment){ } 我这段代码使用了 Retryable,也就是一个方法执行的耗时 可能是 99s 至少,我的 max.poll.interval.ms 设成 3s,返回由于太久没有 ack,超过 max.poll.interval.ms ,被移出 consumer group 。但是我把 interval 设到 10s 以上,竟然就没有看到“This member will leave the group because consumer poll timeout has expired. This means the time between subsequent calls to poll() was longer than the configured max.poll.interval.ms, which typically implies that the poll loop is spending too much time processing messages. You can address this either by increasing max.poll.interval.ms or by reducing the maximum size of batches returned in poll() with max.poll.records.”的字样,这是为啥?

766 次点击
所在节点    程序员
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/778739

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX