Dhinesh
Dhinesh

Reputation: 325

How to get the latest message offset from the FlinkKafkaConsumer?

I am using FlinkKafkaConsumer to consume the data from kafka? but I am not able to get the latest offset from he data received. How to do it in flink?.Could anyone guide me in this?

Upvotes: 1

Views: 635

Answers (1)

Robert Metzger
Robert Metzger

Reputation: 4542

You have to use a custom deserialziation schema called KeyedDeserializationSchema to access the offset for each message.

The deserialize() method has an argument where the framework passes you the offset for each message.

Upvotes: 3

Related Questions