The purpose of the sections in Kafka is to create a partial order of messages in a wider topic, where messages follow a strict general order in any given section. Thus, the answer is no, if we introduce any concept of the order of the partition, the purpose of the sections would be violated.
Instead, I would suggest focusing on how messages (records, in the Kafka language) are key, which effectively determines how they are displayed in the section. Which section does not matter if the mapping is deterministic and reproducible - all you need is that records with the same key will always appear in the same section and, therefore, will not be assigned to several consumers at the same time (in that same consumer group).
If you publish updates to persistent entities, an entity primary key is usually a good starting point for a Kafka record key. If a linked entity graph requires some sort of update order, then getting the root identifier of the graph and turning it into a key is likely to satisfy your ordering needs.
source share