【问题标题】:Why did Kafka Consumer re-processed all the records since last 2 months?为什么 Kafka Consumer 重新处理了过去 2 个月以来的所有记录?
【发布时间】:2020-10-31 02:26:23
【问题描述】:

在其中一种情况下,当消费者服务重新启动时,会导致重新处理所有发送到 Kafka 的记录。

Kafka Broker: 0.10.0.1
Kafka producer Service: Springboot version 1.4.3.Release
Kafka Consumer Springboot Service: Springboot version 2.2.0.Release

现在为了调查这个问题,我想在没有发生的开发/本地环境中重新创建这个场景!!!

可能的原因是什么?

如何检查,当我们发送Acknowledgement.acknowledge();时,从消费者端处理过的记录是否已提交

消费者 - 属性

Enable Auto commit = false;
Auto offset Reset = earliest;
max poll records = 1;
max poll interval ms config = I am calculating the value of this parameter at runtime from the formula ==>> (number_of_retries * x * 2) <= INTEGER.MaxValue

重试策略 - 简单

number of retries = 3;
interval between retries = x (millis)

我在运行时通过 bean NewTopic(topic_name, 1, (**short**)1) 在消费者端创建主题

有 2 个 Kafka 集群和 1 个 Zookeeper 实例正在运行。

任何帮助将不胜感激

【问题讨论】:

    标签: spring-boot apache-kafka kafka-consumer-api spring-kafka kafka-producer-api


    【解决方案1】:

    那个经纪人很老了;如果消费者在 24 小时内没有收到任何记录,则偏移量被删除,重新启动消费者将导致它重新处理所有记录。

    对于较新的代理,它已更改为 7 天,消费者必须停止 7 天才能删除偏移量。

    不再支持 Spring Boot 1.4.x(甚至 1.5.x、2.0.x);当前版本是 2.3.1。

    您应该升级到更新的代理和更新的 Spring Boot 版本。

    【讨论】:

      猜你喜欢
      • 2019-12-30
      • 1970-01-01
      • 1970-01-01
      • 2016-03-28
      • 2017-01-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-03
      相关资源
      最近更新 更多