不可能配置更改日志主题

huangapple go评论50阅读模式
英文:

Not possible to configure changelog topics

问题

我有一个由更改日志主题支持的状态存储。为了限制更改日志主题的大小,我希望为该主题设置cleanup.policy="delete,compact"。然而,当我创建一个全新的状态存储时,无论我如何指定changelogConfigs,配置都不会应用到更改日志主题。无论如何我指定changelogConfigs,更改日志主题都会获得以下配置:

不可能配置更改日志主题
不可能配置更改日志主题

这是一个错误吗,还是我做错了什么?

英文:

I have a state store backed by a changelog topic. In order to limit the size of the changelog topic I wish to set cleanup.policy="delete,compact" for the topic. However, when I'm creating a brand new state store with

val builder = StreamsBuilder()

val changelogConfigs = mapOf(
        "cleanup.policy" to "delete,compact",
        "retention.ms" to "86400000", // 1 day
    )

    builder.addStateStore(
        Stores.keyValueStoreBuilder(
            Stores.persistentKeyValueStore("state-store"),
            Serdes.String(),
            topicSerdeConfig.inputValueSerde
        ).withLoggingEnabled(changeLogConfigs)
    )

the configuration is not applied to the changelog topic. The changelog topic gets the following configuration no matter how I specify changelogConfigs:

不可能配置更改日志主题
不可能配置更改日志主题

Is this a bug, or I am doing something wrong?

答案1

得分: 1

我发现了错误,与Kafka Streams: 迭代开发与蓝绿部署有些相关。

如果我在创建状态存储时也更改了application.id,那么更改日志主题将被正确配置。

如果我只更改状态存储的名称,实际上创建一个新的状态存储,而不更改application.id,状态存储将会使用奇怪的默认配置。

英文:

I found the error, and it is somewhat related to Kafka Streams: Iterative Development and Blue-Green Deployment | by Brett Jordan | Airwallex Engineering | Medium

If I also changed the application.id when creating the state store, the changelog topics were configured properly.

If I only were to change the state store name, effectively making a new state store, and not change the application.id, the state store would be configured with the weird default configuration.

huangapple
  • 本文由 发表于 2023年3月15日 21:03:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/75745113.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定