Re: Partition key not working properly

2014-11-26 Thread François Langelier
is even I hard code the same partition key(let's say the key is 1) for three messages, the messages are still goes to different partitions. Regards, Haoming Date: Wed, 26 Nov 2014 08:03:04 +0100 Subject: Re: Partition key not working properly From: s...@csi.se To: users@kafka.apache.org

RE: Partition key not working properly

2014-11-26 Thread Haoming Zhang
a partition key as Byte Array producer.send(testMessage.getBytes(UTF8), key) } I appreciate all the suggestions and help! Thanks, Haoming From: f.langel...@gmail.com Date: Wed, 26 Nov 2014 19:57:13 + Subject: Re: Partition key not working properly To: users@kafka.apache.org Hi

Re: Partition key not working properly

2014-11-26 Thread Jun Rao
Date: Wed, 26 Nov 2014 19:57:13 + Subject: Re: Partition key not working properly To: users@kafka.apache.org Hi haoming, As far as I know, svante is right. Maybe you modified your default partitioner? or are you sure the same key go to different partitions? maybe its just 2

Partition key not working properly

2014-11-25 Thread Haoming Zhang
Hi all, I'm struggling with how to use the partition key mechanism properly. My logic is set the partition number as 3, then create three partition keys as 0, 1, 2, then use the partition keys to create three KeyedMessage such as KeyedMessage(topic, 0, message), KeyedMessage(topic, 1,

Re: Partition key not working properly

2014-11-25 Thread svante karlsson
By default, the partition key is used for hashing then it's placed in a partition that has the appropriate hashed keyspace. If you have three physical partitions and then give the partition key 5 it has nothing to do with physical partition 5 (that does not exist) , similar to physical: partition

RE: Partition key not working properly

2014-11-25 Thread Haoming Zhang
, Haoming Date: Wed, 26 Nov 2014 08:03:04 +0100 Subject: Re: Partition key not working properly From: s...@csi.se To: users@kafka.apache.org By default, the partition key is used for hashing then it's placed in a partition that has the appropriate hashed keyspace. If you have three