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, I'm pretty sure keys are now retained with the message and returned
in the consumer.

In the Java/Scala client, ConsumerIterator returns a MessageAndMetadata
which includes key, message, topic, partition, and offset


On 5/9/13 10:44 AM, Yu, Libo 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