title: Unable to consume Kafka messages within Spring Boot
body: <p>We have a Java application which consumes Kafka messages, using <code>org.apache.kafka.clients.consumer.KafkaConsumer</code></p>
  
  <p>We have created a Spring Boot application with a Spring-Kafka dependency, but are unable to read the messages within the new project. Have checked the obvious parameters, including hostname and port of the bootstrap servers (which the logs show are recognized), the group, the topic and that Spring Boot, like the original consumer, uses <code>StringDeserializer</code> . Here is our configuration file:</p>
  
  <pre><code>spring:
    kafka:
      bootstrap-servers: hostname1:9092,hostname2:9092
      consumer:
        auto-offset-reset: earliest
        group-id: our_group
        enable-auto-commit: false
        fetch-max-wait: 500
        max-poll-records: 1
  
  kafka:
    topic:
      boot: topic.name 
  </code></pre>
  
  <p>and the receiver:</p>
  
  <pre><code>@Component
  public class Receiver {
  
      private static final Logger LOGGER = LoggerFactory.getLogger(Receiver.class);
  
      private CountDownLatch latch = new CountDownLatch(1);
  
      public CountDownLatch getLatch() {
          return latch;
      }
  
      @KafkaListener(topics = "${kafka.topic.boot}")
      public void receive(ConsumerRecord&lt;?, ?&gt; consumerRecord) {
          LOGGER.info("received payload='{}'", consumerRecord.toString());
          latch.countDown();
      }
  
  }
  </code></pre>
  
  <p>Here is the code to start the Boot application:</p>
  
  <pre><code>@SpringBootApplication
  public class EmsDemoUsingSpringBootApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(EmsDemoUsingSpringBootApplication.class, args);
      }
  }
  </code></pre>
  
  <p>This exception is being caught:</p>
  
  <pre><code>org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.
  </code></pre>
  
  <p>Is there anything obvious I have overlooked?
  What is the best way to debug this?</p>
  
  <p>Thanks</p>