confluent-kafka-go icon indicating copy to clipboard operation
confluent-kafka-go copied to clipboard

allow.auto.create.topics": "false" for producer gives misleading warning

Open samba2 opened this issue 2 years ago • 1 comments

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

samba2 avatar May 18 '22 06:05 samba2

Thanks for reporting this, we are looking into it.

jliunyu avatar May 19 '22 22:05 jliunyu

Closing with merge into librdkafka's master branch.

milindl avatar Nov 08 '22 07:11 milindl