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 <naveenmahes...@gmail.com>
Reply-To: "users@kafka.apache.org" <users@kafka.apache.org>
Date: Tuesday, June 19, 2018 at 5:57 PM
To: "users@kafka.apache.org" <users@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….

Reply via email to