Using spring kafka template, I have 2 different producers that send different messages with the same key to a topic always in the same form:
Producer 1: Sends Key: 1 message: abc partition 0
Producer 2: Sends Key: 2 message: def
I have 3 partitions and all messages are sent to the same according to the message key.
Now, I need to make sure, that according to some properties, specific messages will go to specific partitions to be able to manage some priority in the system.
Thing is Producer 2 doesn't have a way to know which partition the Producer 1 selected.
Kafka assures that messages from different producers sent to with the same key will go to the same partition. But when assigning the partition from the producer 1, producer 2 sends the message with the same key to a different partition.
I've seen information about this, but none with the producer selecting the partition that will use.
Shouldn't kafka keep assigning the same partition to the message even though producer ones picks the partition it will use?