I am writing Kafka Consumer for high volume high velocity distributed application. I have only one topic but rate incoming messages is very high. Having multiple partition that
/**
* @param source : source kStream to sink output-topic
*/
private static void pipe(KStream source) {
source.to(Serdes.String(), Serdes.String(), new StreamPartitioner() {
@Override
public Integer partition(String arg0, String arg1, int arg2) {
return 0;
}
}, "output-topic");
}
above code will write record at partition 1 of topic name "output-topic"