英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论