title: Infinite loop Kafka Consumer
body: <p>I'm testing some basic Kafka feature, I have basics <code>zookeeper/kafka</code> servers running on a Ubuntu Server 18.04 LTS virtual machine. And I use the <code>kafka-node</code> module.  </p>
  
  <p>This script should be waiting for new message to arrive in order to consume it.
  But it is stuck in an infinite loop as soon as I launch it.   </p>
  
  <p>I can't find where it comes from,</p>
  
  <pre><code>"use strict"
  require('dotenv').config();
  var kafka = require('kafka-node');
  
  const client = new kafka.Client("localhost:2181");
  var topics = [{
    topic: 'stuff',
    offset: 0
  }];
  var options = {
    autoCommit: false
  }
  const HLConsumer = new kafka.HighLevelConsumer(client, topics, options);
  
  HLConsumer.on('message', function(message) {
    console.log(message);
  });
  
  HLConsumer.on('error', function(err) {
    console.log('error', err);
  });
  
  HLConsumer.on('offsetOutOfRange', function(err) {
    console.log('offsetOutOfRange:', err);
  })
  </code></pre>
  
  <p>Have a nice day every one, and thanks</p>
  
  <p>Edit 1 : </p>
  
  <p>I updated as requested <code>autoCommit</code> to <code>true</code> and still have to problem.
  Here is a cheap gif of the issues, in fact it loop through every offset and then read 10/15 message with an offset of 0 then restart looping on every offset of the topic
  <a href="https://i.stack.imgur.com/0W6WW.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0W6WW.gif" alt="gif loop"></a></p>