You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Lesong Jia <le...@gmail.com> on 2015/11/17 21:55:52 UTC

Custom metadata in message header

Hey all,

I am new to Kafka. Is there a way to provide a custom metadata in the
message header?

Thanks,
Lesong

Re: Custom metadata in message header

Posted by Lance Laursen <ll...@rubiconproject.com>.
Hey Lesong,

Unfortunately not. Any metadata you would like to include must be placed in
the message payload. This means you must consume each message and process
it in order to determine whether it is relevant to your current task.

You can achieve some data locality by using keyed messages and an
associated partitioner.class (ie: semantic partitioning). This will result
in messages with a common key ending up on the same partition, thereby
reducing the workload of your consumer.

On Tue, Nov 17, 2015 at 12:55 PM, Lesong Jia <le...@gmail.com> wrote:

> Hey all,
>
> I am new to Kafka. Is there a way to provide a custom metadata in the
> message header?
>
> Thanks,
> Lesong
>