You typically do have a single consumer per partition (in a single consumer group — so in the group of consumers jointly working on some task). However, you need first to get “related” events into the same partition — that’s where a Partitioner comes in.

So if you have 10 partitions, and you’d like all events relating to user with id 42 being written in the same partition, your partitioner would probably somehow use the id to generate the partition number.

Scala software engineer, Functional Programming enthusiast, SoftwareMill co-founder

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store