Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3262C10C0D for ; Sun, 4 May 2014 08:25:18 +0000 (UTC) Received: (qmail 47264 invoked by uid 500); 4 May 2014 08:25:16 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 47172 invoked by uid 500); 4 May 2014 08:25:14 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 47151 invoked by uid 99); 4 May 2014 08:25:13 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 May 2014 08:25:13 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 81A9089BAF3; Sun, 4 May 2014 08:25:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: davsclaus@apache.org To: commits@camel.apache.org Date: Sun, 04 May 2014 08:25:13 -0000 Message-Id: <65fbee19900a41c3ae20f899e2d94bb0@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/3] git commit: [CAMEL-7306]: key is optional. Avoid NPE Repository: camel Updated Branches: refs/heads/camel-2.13.x ad26ff0bd -> 86060eed7 refs/heads/master a6fb1df10 -> 8b78f5ca9 [CAMEL-7306]: key is optional. Avoid NPE Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e317e7b4 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e317e7b4 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e317e7b4 Branch: refs/heads/master Commit: e317e7b470f03d14fe51b9efcc6d251e869c8224 Parents: cd8da7d Author: Grzegorz Grzybek Authored: Tue Apr 8 15:21:54 2014 +0200 Committer: Grzegorz Grzybek Committed: Tue Apr 8 15:21:54 2014 +0200 ---------------------------------------------------------------------- .../java/org/apache/camel/component/kafka/KafkaEndpoint.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/e317e7b4/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java index 9bdb100..002d15e 100644 --- a/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java +++ b/components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaEndpoint.java @@ -89,7 +89,9 @@ public class KafkaEndpoint extends DefaultEndpoint { Message message = new DefaultMessage(); message.setHeader(KafkaConstants.PARTITION, mm.partition()); message.setHeader(KafkaConstants.TOPIC, mm.topic()); - message.setHeader(KafkaConstants.KEY, new String(mm.key())); + if (mm.key() != null) { + message.setHeader(KafkaConstants.KEY, new String(mm.key())); + } message.setBody(mm.message()); exchange.setIn(message);