title: How can I read the latest entry in Kafka?
body: <p>I'm using the <a href="https://github.com/confluentinc/confluent-kafka-dotnet" rel="nofollow noreferrer">.NET Client library</a> from Confluent.</p>
  
  <p>I need to connect to a topic and read back <em>the last message</em> written in it. I cannot use an absolute offset because I do not know it, and logical offsets do not appear to help. In particular <code>Offset.End</code> puts the <em>cursor</em> just <em>after</em> the last entry, hence any subsequent read call (like <code>Consume</code>) would return either a newer entry, if available, or <code>null</code>, but not the latest available at the very moment of the call.</p>
  
  <p>I'm actually wondering if it is a sensible use case in Kafka parlance (I'm quite new to it). I found a few examples of similar cases, but nothing explaining this one, and I cannot find a good way to adapt those other cases to mine. I also tried to do some arithmetics with cursors, like summing/subtracting them (i.e. <code>Offset.End-1</code> or <code>Offset.End-new Offset(1)</code>), but what I get is clearly abnormal cursors which cannot be used. Which makes me think: why <code>+</code> and <code>-</code> have been defined at all for <code>Offset</code> if then they allow you to craft invalid values? But that is a different story.</p>