【问题标题】:Kafka 2.1 behaviour change for retentions and Kafka Stream application, what can we so that retention works?保留和 Kafka Stream 应用程序的 Kafka 2.1 行为更改,我们可以让保留起作用吗?
【发布时间】:2019-02-26 06:18:27
【问题描述】:

以下内容来自 Kafka 2.1 文档。

https://kafka.apache.org/documentation/

Offset expiration semantics has slightly changed in this version. 
According to the new semantics, offsets of partitions in a group will 
not be removed while the group is subscribed to the corresponding 
topic and is still active (has active consumers). If group becomes 
empty all its offsets will be removed after default offset retention 
period (or the one set by broker) has passed (unless the group becomes 
active again). Offsets associated with standalone (simple) consumers, 
that do not use Kafka group management, will be removed after default 
offset retention period (or the one set by broker) has passed since 
their last commit.

如果我理解正确的话,只要连接了 Stream Thread 消费者,没有保留设置将生效?

流应用重启后我也开始观察到以下异常

流线程 - 恢复流任务失败。删除 StreamTasks 存储以从头开始重新创建。 org.apache.kafka.clients.consumer.OffsetOutOfRangeException:偏移超出范围,没有为分区配置重置策略:'但流应用程序使用属性'StreamsConfig.consumerPrefix(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG),“最早”'......

我认为这与留存率有关,但我不知道是什么?

【问题讨论】:

    标签: apache-kafka-streams


    【解决方案1】:

    如果我理解正确的话,只要连接了 Stream Thread 消费者,没有保留设置将生效?

    这仅适用于 __consumer_offset 主题,即 Kafka 内部主题。对于所有常规/用户主题,保留时间的应用方式与所有先前版本相同。另请注意,这仅适用于您将代理升级到2.1

    对于 Streams 的日志信息:您无需担心。您的应用程序似乎离线的时间更长,因此您的本地商店不再处于一致状态。因此,它已从更改日志主题中删除并重新创建。

    【讨论】:

      猜你喜欢
      • 2019-08-06
      • 2015-05-21
      • 1970-01-01
      • 2021-10-20
      • 1970-01-01
      • 2021-09-03
      • 1970-01-01
      • 1970-01-01
      • 2016-09-03
      相关资源
      最近更新 更多