Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kafka: TopicCreator.CreateTopics performs unnecessary topic updates #331

Open
axw opened this issue Nov 27, 2023 · 0 comments
Open

kafka: TopicCreator.CreateTopics performs unnecessary topic updates #331

axw opened this issue Nov 27, 2023 · 0 comments

Comments

@axw
Copy link
Member

axw commented Nov 27, 2023

if len(existingTopics) > 0 && len(c.topicConfigs) > 0 {
alterCfg := make([]kadm.AlterConfig, 0, len(c.topicConfigs))
for k, v := range c.topicConfigs {
alterCfg = append(alterCfg, kadm.AlterConfig{Name: k, Value: v})
}
alterResp, err := c.m.adminClient.AlterTopicConfigs(ctx,
alterCfg, existingTopics...,
)

As soon as a topic has been created, this code will always trigger an AlterTopicConfigs if there are any topic configs defined. This creates unnecessary API calls to Kafka, and creates log spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant