How to get the latest offset from the Kafka topic in Confluent kafka C# library?

Viewed 10734

I am using Confluent kafka C# client. how to get the latest offset consumed from a topic in this?

4 Answers

You can use the Position() method from the consumer like:

var partition = 0;
Offset lastOffset = _kafkaConsumer.Position(new TopicPartition("topic", partition));
Related