Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Kafka >> mail # user >> Re: key used by producer

Copy link to this message
Re: key used by producer
Yes, our consumer iterator returns MessageAndMetadata. You can do
consumerIterator.next().key() to get the key.


On Thu, May 9, 2013 at 7:44 AM, Yu, Libo <[EMAIL PROTECTED]> wrote:

> Hi,
> I am looking at the example producer code for kafka 0.8.
> I notice it is possible to specify a key when creating
> KeyedMessage. This key will be used for assigning the
> message to some partition. I wonder if the key will be
> received by the consumer. Thanks.
> Libo