title: Kafka consumer (using kafka-net) fetching all messages from the beginning by default
body: <p>I'm building a Kafka consumer for my .net proyect. I'm using kafka-net (A native c# client fro Apache Kafka mady by James Roland).</p>
  
  <p>The problem I have is that this code (based on the documentation) fetches all messages from the beginning by default:</p>
  
  <pre><code>private void StartKafkaConsumer(string ipKafka, string portKafka, string topicKafka)
      {
          string topic = topicKafka;
          Uri uri = new Uri($"http://{ipKafka}:{portKafka}");
          var options = new KafkaOptions(uri);
  
  
          using (var router = new BrokerRouter(options))
          {
              using (var consumer = new Consumer(new ConsumerOptions(topic, router)))
              {
                  foreach (var message in consumer.Consume())
                  {
  
                      Console.WriteLine(Encoding.UTF8.GetString(message.Value));
                  }
              }
          }
      }
  ...
  StartKafkaConsumer("localhost", "9092", "test");  //this fetches messages sent weeks ago, since the creation of the 'test' topic
  </code></pre>
  
  <p>Basically, this code does the same than this command:</p>
  
  <pre><code>.\bin\windows\kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic test --from-beginning
  </code></pre>
  
  <p>All I want to do is to fetch messages from the time the client gets connected to the Apache server, not from the beginning. I know it's possible since I tried the last command without the "--from-beginning" part and it worked.</p>
  
  <p>Any suggestion would be appreciated.</p>