Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3B667109E4 for ; Mon, 29 Dec 2014 17:24:14 +0000 (UTC) Received: (qmail 33156 invoked by uid 500); 29 Dec 2014 17:24:14 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 32941 invoked by uid 500); 29 Dec 2014 17:24:14 -0000 Mailing-List: contact issues-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 issues@camel.apache.org Received: (qmail 32768 invoked by uid 99); 29 Dec 2014 17:24:14 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Dec 2014 17:24:14 +0000 Date: Mon, 29 Dec 2014 17:24:14 +0000 (UTC) From: "Ivan Vasyliev (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CAMEL-8190) Kafka producer: partition key is optional, not required by kafka client api MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAMEL-8190?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ivan Vasyliev updated CAMEL-8190: --------------------------------- Attachment: kafka_producer__partition_key_is_optional.patch > Kafka producer: partition key is optional, not required by kafka client api > --------------------------------------------------------------------------- > > Key: CAMEL-8190 > URL: https://issues.apache.org/jira/browse/CAMEL-8190 > Project: Camel > Issue Type: Bug > Components: camel-kafka > Affects Versions: 2.14.1 > Reporter: Ivan Vasyliev > Fix For: 2.15.0 > > Attachments: kafka_producer__partition_key_is_optional.patch > > > In order to send to kafka, one need to construct KeyedMessage. > {code} > public KeyedMessage(String topic, K key, Object partKey, V message) { > this.topic = topic; > this.key = key; > this.partKey = partKey; > this.message = message; > class.$init$(this); > if(topic == null) { > throw new IllegalArgumentException("Topic cannot be null."); > } > } > public KeyedMessage(String topic, V message) { > Object var10002 = null; > Object var10003 = null; > this(topic, (Object)null, (Object)null, message); > } > public KeyedMessage(String topic, K key, V message) { > {code} > Looks like only topic is required parameter, but partition key is optional. Also, if key is provided by the user I think is makes sense to propagate it. -- This message was sent by Atlassian JIRA (v6.3.4#6332)