Re: Does kafka write key to broker?

2015-07-01 Thread Mohit Kathuria
Guozhang, Thanks for the reply. That's exactly what I was looking for. -Thanks, Mohit On Tue, Jun 30, 2015 at 1:52 AM, Guozhang Wang wrote: > Hi Mohit, > > The KeyedMessage has a "key" and "partKey" as it fields, and if the partKey > is not specified then key will be used as partKey by default

Re: Does kafka write key to broker?

2015-06-29 Thread Guozhang Wang
Hi Mohit, The KeyedMessage has a "key" and "partKey" as it fields, and if the partKey is not specified then key will be used as partKey by default. So for your case, if you do new KeyedMessage[String, String](topic, null /*key*/, partkey, value) then the partkey will be used to determine the pa

Re: Does kafka write key to broker?

2015-06-24 Thread Mohit Kathuria
Thanks Jason. Hi Liquan, I was doing this initially using KeyedMessage without setting the key. But if the key is null, the custom partitioner won't be used and kafka will write to random partition which is cached for some time within the producer. I have a custom partitioner to have fairness bet

Re: Does kafka write key to broker?

2015-06-23 Thread Liquan Pei
Hi Mohit, If you instantiate the keyed message with val topic = "topic" val value = "value" val message = new KeyedMessage[String, String](topic, value); Then the key in the KeyedMessage will be null. Hope this helps! Thanks, Liquan On Tue, Jun 23, 2015 at 8:18 AM, Mohit Kathuria wrote: > H

Re: Does kafka write key to broker?

2015-06-23 Thread Jason Gustafson
Hey Mohit, Unfortunately, I don't think there's any such configuration. By the way, there are some pretty cool things you can do with keys in Kafka (such as semantic partitioning and log compaction). I don't know if they would help in your use case, but it might be worth checking out http://kafka

Does kafka write key to broker?

2015-06-23 Thread Mohit Kathuria
Hi, We are using kafka 0.8.1.1 in our production cluster. I recently started specifying key as the message itself. I just realised that the key is also written to the broker which means that the data is duplicated within a keyed message. I am going to change the key. Stupid mistake. However, just