79666479

Date: 2025-06-15 10:25:06
Score: 1
Natty:
Report link

When the key is null the default partitioner will be used. This means that, as you noted, the message will be sent to one of the available partitions at random. A round-robin algorithm will be used in order to balance the messages among the partitions.

After Kafka 2.4, the round-robin algorithm in the default partitioner is sticky - this means it will fill a batch of messages for a single partition before going onto the next one.

Of course, you can specify a valid partition when producing the message and it will be respected.

Ordering will not differ - messages will get appended to the log in the same order by their arrival time regardless if they have a key or not.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Starts with a question (0.5): When the
  • Low reputation (0.5):
Posted by: pyordanov11