camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: CAMEL-10993: camel-kafka should not WARN for each sent message that has no key
Date Sun, 12 Mar 2017 08:55:10 GMT
Repository: camel
Updated Branches:
  refs/heads/master 388654964 -> 330228ac7


CAMEL-10993: camel-kafka should not WARN for each sent message that has no key


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

Branch: refs/heads/master
Commit: 330228ac709a46c6aee2dcb9d31ded4b23012422
Parents: 3886549
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Sun Mar 12 09:55:02 2017 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sun Mar 12 09:55:02 2017 +0100

----------------------------------------------------------------------
 .../java/org/apache/camel/component/kafka/KafkaProducer.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/330228ac/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
index 53410e6..65fd9d2 100644
--- a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
+++ b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaProducer.java
@@ -167,8 +167,9 @@ public class KafkaProducer extends DefaultAsyncProducer {
                         return new ProducerRecord(msgTopic, partitionKey, key, value);
                     } else if (hasMessageKey) {
                         return new ProducerRecord(msgTopic, key, value);
+                    } else {
+                        return new ProducerRecord(msgTopic, value);
                     }
-                    return new ProducerRecord(msgTopic, value);
                 }
 
                 @Override
@@ -187,7 +188,6 @@ public class KafkaProducer extends DefaultAsyncProducer {
         } else if (hasMessageKey) {
             record = new ProducerRecord(topic, key, value);
         } else {
-            log.warn("No message key or partition key set");
             record = new ProducerRecord(topic, value);
         }
         return Collections.singletonList(record).iterator();


Mime
View raw message