The documentation says that the only purpose of the "key" is to decide the
partition the data ends up in. The consumer doesn't decide that. I'll have
to look at the documentation but I'm not entirely sure if the consumers
have access to this key. The producer does. You can override the default
partitioner class and write one that uses your understands and interprets
your definition of the key to place data in a specific partition. By
default, I believe data is distributed using a round robin partitioner.



On Thu, Mar 31, 2016 at 2:58 AM, Marcelo Oikawa <marcelo.oik...@webradar.com
> wrote:

> Hi, list.
>
> We're working on a project that uses Kafka and we notice that for every
> message we have a key (or null). I searched for more info about the key
> itself and the documentation says that it is only used to decide the
> partition where the message is placed.
>
> Is there a problem if we use keys with the application semantics
> (metadata)? For instance, we can use the key "origin:foo;target:boo" and
> the consumers may use the key info to make decisions. But, a lot of
> messages may use the same key and it may produce unbalanced partitions, is
> that right?
>
> Does anyone know more about the key and your role inside kafka?
>
> []s
>



-- 
--
Sharninder

Reply via email to