I am aware of kafka console producer
command and it is quite handy. I want to know is there a way to know for sure which key will go to which partition when we have key as well? Assuming we have 10 partitions in kafka topic, how will producer decide to which partition the key will go?
I thought it might use key.toString.hashCode() % (num_of_partitons)
, but i don't think this is the way kafka console producer employs.
Can we check to which partition producer will send data to?