camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan Vasyliev (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAMEL-8190) Kafka producer: partition key is optional, not required by kafka client api
Date Mon, 29 Dec 2014 17:24:14 GMT

     [ 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)

Mime
View raw message