'Avoid warn messages ‘schema.registry.url’ was supplied but isn’t a known config on kafka configuration

I’m using spring-kakfa and I’m having this warn messages in logs:

WARN  org.apache.kafka.clients.admin.AdminClientConfig The configuration 'schema.registry.url' was supplied but isn't a known config.
WARN org.apache.kafka.clients.consumer.ConsumerConfig The configuration 'schema.registry.url' was supplied but isn't a known config.
WARN org.apache.kafka.clients.producer.ProducerConfig The configuration 'schema.registry.url' was supplied but isn't a known config.
WARN org.apache.kafka.clients.consumer.ConsumerConfig The configuration 'schema.registry.url' was supplied but isn't a known config.

In my Java configuration class I set this configuration:

config.put(KafkaAvroSerializerConfig.SCHEMA_REGISTRY_URL_CONFIG, kafkaGenericConfiguration.getSchemaRegistryUrl());

And in my YAML configuration file, I try several configuration types but it keep getting error…

spring: 
  kakfa:
    properties: 
      schema.registry.url: "http://localhost:8081"
    default:
      producer:
        configuration: 
          schema.registry.url: "http://localhost:8081"
    producer: 
      properties: 
        schema.registry.url: "http://localhost:8081"

Could you please advice how to solve this error? Thanks in advance!



Solution 1:[1]

Setting the property at the top level sets it for all components, including the admin, for which it clearly has no relevance; so remove that one.

I agree that the consumer and producer logs are annoying, but I can see why they want to log unexpected properties, in case of typos; but it is common to use consumer and producer configs to configure serializers and deserializers.

So, it's hard to know what is the best thing to do.

I suggest you open an issue against the kafka-clients to see if you can get some traction there.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gary Russell