Assigning partition when no message key or partition is specified

The data is next sent to the partitioner. If the partition has been specified in ProduceRecord then the partitioner takes no action and simply returns the already specified partition. If the partition is not specified, the partitioner selects a partition based on the key.

What happens when neither the message key nor the partition are specified? How is partition assigned in that case?

Type your question above this line.