title: Kafka js quick example errors
body: <p>I have this very simple code which is supposed just to transmit a simple message from producer to consumer using Kafka in local host which come from <a href="https://github.com/tulios/kafkajs" rel="nofollow noreferrer">the official GitHub</a></p>
  <pre><code>const { Kafka } = require('kafkajs')
  
  const kafka = new Kafka({
    clientId: 'my-app',
    brokers: ['kafka1:9092', 'kafka2:9092']
  })
  
  const producer = kafka.producer()
  const consumer = kafka.consumer({ groupId: 'test-group' })
  
  const run = async () =&gt; {
    // Producing
    await producer.connect()
    await producer.send({
      topic: 'test-topic',
      messages: [
        { value: 'Hello KafkaJS user!' },
      ],
    })
  
    // Consuming
    await consumer.connect()
    await consumer.subscribe({ topic: 'test-topic', fromBeginning: true })
  
    await consumer.run({
      eachMessage: async ({ topic, partition, message }) =&gt; {
        console.log({
          partition,
          offset: message.offset,
          value: message.value.toString(),
        })
      },
    })
  }
  
  run().catch(console.error)
  </code></pre>
  <p>When I execute this code using <code>node index.js</code> (which is this file) I get many of these two errors :</p>
  <pre><code>{&quot;level&quot;:&quot;ERROR&quot;,&quot;timestamp&quot;:&quot;2021-03-29T12:01:00.633Z&quot;,&quot;logger&quot;:&quot;kafkajs&quot;,&quot;message&quot;:&quot;[Connection] Connection error: getaddrinfo ENOTFOUND kafka1&quot;,&quot;broker&quot;:&quot;kafka1:9092&quot;,&quot;clientId&quot;:&quot;my-app&quot;,&quot;stack&quot;:&quot;Error: getaddrinfo ENOTFOUND kafka1\n    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:60:26)&quot;}
  
  {&quot;level&quot;:&quot;ERROR&quot;,&quot;timestamp&quot;:&quot;2021-03-29T12:01:00.635Z&quot;,&quot;logger&quot;:&quot;kafkajs&quot;,&quot;message&quot;:&quot;[BrokerPool] Failed to connect to seed broker, trying another broker from the list: Connection error: getaddrinfo ENOTFOUND kafka1&quot;,&quot;retryCount&quot;:0,&quot;retryTime&quot;:323}
  </code></pre>
  <p>So it looks like the first lines defining the broker on local port 9092 are not working I guess? But I don't know how to correct this. Could you help me please?</p>