t;)
> val producer = new KafkaProducer(testTopic, "localhost:9092")
>
> val numList = List(0,1,2);
> for (a <- numList) {
> var key = java.nio.ByteBuffer.allocate(4).putInt(a).array() // Create
> a partition key as Byte Array
> producer.send(testMess
producer = new KafkaProducer(testTopic, "localhost:9092")
val numList = List(0,1,2);
for (a <- numList) {
var key = java.nio.ByteBuffer.allocate(4).putInt(a).array() // Create a
partition key as Byte Array
producer.send(testMessage.getBytes("UTF8"), key)
}
I ap
key goes to the
> same partition", but the actual case 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
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
>
> By default, the partition key is used for hashing then it's placed in a
> partition that ha
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: partitio
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,