kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gwen Shapira <gshap...@cloudera.com>
Subject Re: Kafka design pattern question - multiple user ids
Date Mon, 15 Dec 2014 18:46:36 GMT
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);


Hope this helps,

On Mon, Dec 15, 2014 at 10:29 AM, Harold Nguyen <harold@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

View raw message