You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Naveen Mahesh <na...@gmail.com> on 2018/06/19 11:59:37 UTC

Doubt related to Kafka Streams

Hi there,
While using Kafka streams, I’m stuck with a problem. I’m unable to find a
suitable method to print the partition number and offset value of the
messages retrieved from the topic. Its pretty easy to find the key and
value of the message but I’m unable to get the partition number and offset
number as provided in Kafka consumer. It will be more helpful if anyone
reply me, with a solution for my doubt.
A clear description of the problem is attached as a screenshot below
Thanks in advance.
Naveen,India….

Re: Doubt related to Kafka Streams

Posted by Virgil Palanciuc <vi...@adobe.com.INVALID>.
It’s in the ProcessorContext: https://kafka.apache.org/0110/javadoc/org/apache/kafka/streams/processor/ProcessorContext.html (methods offset(), partition() ).

You can get the context by invoking the method context() in any AbstractProcessor: https://kafka.apache.org/0110/javadoc/org/apache/kafka/streams/processor/AbstractProcessor.html

Virgil.

From: Naveen Mahesh <na...@gmail.com>
Reply-To: "users@kafka.apache.org" <us...@kafka.apache.org>
Date: Tuesday, June 19, 2018 at 5:57 PM
To: "users@kafka.apache.org" <us...@kafka.apache.org>
Subject: Doubt related to Kafka Streams

Hi there,
While using Kafka streams, I’m stuck with a problem. I’m unable to find a suitable method to print the partition number and offset value of the messages retrieved from the topic. Its pretty easy to find the key and value of the message but I’m unable to get the partition number and offset number as provided in Kafka consumer. It will be more helpful if anyone reply me, with a solution for my doubt.
A clear description of the problem is attached as a screenshot below
Thanks in advance.
Naveen,India….