Guillaume Grossetie created KAFKA-2898: ------------------------------------------
Summary: Kafka producer config incorrectly warns that serializer.* isn't a known config Key: KAFKA-2898 URL: https://issues.apache.org/jira/browse/KAFKA-2898 Project: Kafka Issue Type: Improvement Affects Versions: 0.8.2.1 Reporter: Guillaume Grossetie Priority: Minor When using "serializer.encoding", "key.serializer.encoding" or "value.serializer.encoding" to configure the encoding of the serializer, Kafka producer incorrectly warns: {code} config.put("serializer.encoding", serializerEncoding); config.put("key.serializer.encoding", keySerializerEncoding); config.put("value.serializer.encoding", valueSerializerEncoding); new KafkaProducer<>(config); {code} {code} [main] WARN o.a.k.c.producer.ProducerConfig - The configuration serializer.encoding = null was supplied but isn't a known config. [main] WARN o.a.k.c.producer.ProducerConfig - The configuration value.serializer.encoding = null was supplied but isn't a known config. [main] WARN o.a.k.c.producer.ProducerConfig - The configuration key.serializer.encoding = null was supplied but isn't a known config. {code} With the following code I get: {code} Map<String, String> serializerConfig = new HashMap<>(); serializerConfig.put("serializer.encoding", serializerEncoding); serializerConfig.put("key.serializer.encoding", keySerializerEncoding); serializerConfig.put("value.serializer.encoding", valueSerializerEncoding); StringSerializer keySerializer = new StringSerializer(); keySerializer.configure(serializerConfig, true); StringSerializer valueSerializer = new StringSerializer(); valueSerializer.configure(serializerConfig, false); new KafkaProducer<>(config, keySerializer, valueSerializer); {code} {code} [main] WARN o.a.k.c.producer.ProducerConfig - The configuration value.serializer = class org.apache.kafka.common.serialization.StringSerializer was supplied but isn't a known config. [main] WARN o.a.k.c.producer.ProducerConfig - The configuration key.serializer = class org.apache.kafka.common.serialization.StringSerializer was supplied but isn't a known config. {code} However I think this case is now fixed in master because someone adds: {code} config.ignore(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG); config.ignore(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG); {code} I think "serializer.encoding", "key.serializer.encoding" or "value.serializer.encoding" configs should also be ignored because they are used in StringSerializer (using a copy of the config: "config.originals()") -- This message was sent by Atlassian JIRA (v6.3.4#6332)