kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject kafka git commit: KAFKA-4434; KafkaProducer configuration is logged twice
Date Wed, 04 Jan 2017 09:53:09 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk d62ef5525 -> ac57d1751


KAFKA-4434; KafkaProducer configuration is logged twice

ProducerConfig calls AbstractConfig.init where does the logs. KafkaProducer init will inovoke
ProducerConfig.init twice that leads to logging twice.

Author: huxi <huxi@zhenrongbao.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes #2307 from amethystic/kafka-4434_Kafkaproducer_log_twice


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/ac57d175
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/ac57d175
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/ac57d175

Branch: refs/heads/trunk
Commit: ac57d1751186967bcba6aceffa6857a4449fa70c
Parents: d62ef55
Author: huxi <huxi@zhenrongbao.com>
Authored: Wed Jan 4 09:41:14 2017 +0000
Committer: Ismael Juma <ismael@juma.me.uk>
Committed: Wed Jan 4 09:41:14 2017 +0000

----------------------------------------------------------------------
 .../java/org/apache/kafka/clients/producer/KafkaProducer.java    | 2 +-
 .../java/org/apache/kafka/clients/producer/ProducerConfig.java   | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/ac57d175/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java
----------------------------------------------------------------------
diff --git a/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java b/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java
index 36cda68..e23f74d 100644
--- a/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java
+++ b/clients/src/main/java/org/apache/kafka/clients/producer/KafkaProducer.java
@@ -253,7 +253,7 @@ public class KafkaProducer<K, V> implements Producer<K, V>
{
 
             // load interceptors and make sure they get clientId
             userProvidedConfigs.put(ProducerConfig.CLIENT_ID_CONFIG, clientId);
-            List<ProducerInterceptor<K, V>> interceptorList = (List) (new ProducerConfig(userProvidedConfigs)).getConfiguredInstances(ProducerConfig.INTERCEPTOR_CLASSES_CONFIG,
+            List<ProducerInterceptor<K, V>> interceptorList = (List) (new ProducerConfig(userProvidedConfigs,
false)).getConfiguredInstances(ProducerConfig.INTERCEPTOR_CLASSES_CONFIG,
                     ProducerInterceptor.class);
             this.interceptors = interceptorList.isEmpty() ? null : new ProducerInterceptors<>(interceptorList);
 

http://git-wip-us.apache.org/repos/asf/kafka/blob/ac57d175/clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java
----------------------------------------------------------------------
diff --git a/clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java b/clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java
index 73bf1c8..89a2a6f 100644
--- a/clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java
+++ b/clients/src/main/java/org/apache/kafka/clients/producer/ProducerConfig.java
@@ -340,6 +340,10 @@ public class ProducerConfig extends AbstractConfig {
         super(CONFIG, props);
     }
 
+    ProducerConfig(Map<?, ?> props, boolean doLog) {
+        super(CONFIG, props, doLog);
+    }
+
     public static Set<String> configNames() {
         return CONFIG.names();
     }


Mime
View raw message