confluent-kafka-go
confluent-kafka-go copied to clipboard
allow.auto.create.topics": "false" for producer gives misleading warning
Description
While trying to workaround the auto-created topic when using GetMetadata()
with the admin client, I found help in this issue: #726
The solution was to set the default for the underlying producer to "false": "allow.auto.create.topics": "false"
This works (tnx for documenting it in #726) but I get the following warning which is obviously wrong:
%4|1652854065.186|CONFWARN|rdkafka#producer-1| [thrd:app]: Configuration property allow.auto.create.topics is a consumer property and will be ignored by this producer instance
In fact the config did work and was not ignored. I could verify that since no topic was created when fetching with GetMetadata()
How to reproduce
// outputs %4|1652854065.186|CONFWARN|rdkafka#producer-1| [thrd:app]: Configuration property allow.auto.create.topics is a consumer property and will be ignored by this producer instance
func myfunc() {
a, err := confkafka.NewAdminClient(&confkafka.ConfigMap{
"bootstrap.servers": config.BrokerAddress,
"allow.auto.create.topics": "false",
})
if err != nil {
log.Fatalf("Failed to create Admin client: %v", err)
}
defer a.Close()
}
Checklist
Please provide the following information:
- [ ] confluent-kafka-go and librdkafka version (
LibraryVersion()
): 1.8.2 - [ ] Apache Kafka broker version: Confluent Kafka 7.0.1
- [ ] Client configuration: see code example
- [ ] Operating system: Linux
Thanks for reporting this, we are looking into it.
Closing with merge into librdkafka's master branch.