When you send messages to Kafka you send a <key,value> pair. The key can include the user id.
Here's how: KeyedMessage<String, byte[]> data = new KeyedMessage<String, byte[]> (user_id, user_id, event); producer.send(data); Hope this helps, Gwen On Mon, Dec 15, 2014 at 10:29 AM, Harold Nguyen <har...@nexgate.com> wrote: > Hello Kafka Experts! > > Sorry if this has been answered before - I was hoping for a quick response > to a naive questions for a newbie like myself! > > If I have multiple users, how do I split the streams so that they > correspond with different user ids ? > > Suppose I have tens of thousands of user ids that I want to keep track of. > Is there a way to write to Kafka and associate a "key" with it ? (The key > being the user id?) Or is there a better way to do this ? > > Thanks so much for your time! > > Harold