Search code examples
apache-kafkaapache-flinkflink-streaming

How can I print starting offset of each partition of Kafka topic from which Flink has started reading?


I want to print the starting offset of each partition of the Kafka topic from which Flink has started reading?


Solution

  • If you use a KafkaDeserializationSchema to handle deserialization with your FlinkKafkaConsumer, the deserialize method is passed a ConsumerRecord, which includes the partition and offset. You could print or log that the first time the method is called.