You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Gaurav Agarwal <ga...@gmail.com> on 2015/10/20 05:40:46 UTC
Regarding Custom Partitioner
Hello
I created Custom partitioner for my need implemented Partitioner interface
Override this method
public int partition(Object key, int a_numPartitions){
return partitionId;
}
We have something called as
We are using key as correlationId, That will be unique for each message .
KeyedMessage<byte[],byte[]> data = new
KeyedMessage<byte[],byte[]>(
"topic",SerialationUtils.serialize(key),partitions,message);
so when i will say producer.send(keyedMessage{It will be message});
Will it call Custom Partitioner that i add in producerConfig and key and
partition
s will be same as in the partition method of Custom Partitioner ?
Please confirm and let me know.
Thanks