Calculate kafka partition of a message by key
and the number of partitions of the topic