title: Failed to create new KafkaAdminClient
body: <p>I get the following error whenever trying to run my spring boot Kafka application.</p>
  <pre><code>2020-08-04 20:17:23.366 ERROR 2827 --- [           main] o.springframework.kafka.core.KafkaAdmin  : Could not create admin
  
  org.apache.kafka.common.KafkaException: Failed to create new KafkaAdminClient
      at org.apache.kafka.clients.admin.KafkaAdminClient.createInternal(KafkaAdminClient.java:479) ~[kafka-clients-2.5.0.jar:na]
      at org.apache.kafka.clients.admin.Admin.create(Admin.java:71) ~[kafka-clients-2.5.0.jar:na]
      at org.apache.kafka.clients.admin.AdminClient.create(AdminClient.java:49) ~[kafka-clients-2.5.0.jar:na]
      at org.springframework.kafka.core.KafkaAdmin.initialize(KafkaAdmin.java:177) [spring-kafka-2.5.2.RELEASE.jar:2.5.2.RELEASE]
      at org.springframework.kafka.core.KafkaAdmin.afterSingletonsInstantiated(KafkaAdmin.java:157) [spring-kafka-2.5.2.RELEASE.jar:2.5.2.RELEASE]
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:910) [spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) [spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) [spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
      at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
      at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
      at ai.kollie.kafka.KafkaApplication.main(KafkaApplication.java:19) [main/:na]
  Caused by: org.apache.kafka.common.config.ConfigException: Invalid url in bootstrap.servers: ${spring.kafka.bootstrap-servers
      at org.apache.kafka.clients.ClientUtils.parseAndValidateAddresses(ClientUtils.java:59) ~[kafka-clients-2.5.0.jar:na]
      at org.apache.kafka.clients.ClientUtils.parseAndValidateAddresses(ClientUtils.java:48) ~[kafka-clients-2.5.0.jar:na]
      at org.apache.kafka.clients.admin.KafkaAdminClient.createInternal(KafkaAdminClient.java:439) ~[kafka-clients-2.5.0.jar:na]
      ... 15 common frames omitted
  </code></pre>
  <p>Now, I have used <code>spring.kafka.bootstrap-servers</code> to set the server to <code>localhost:9092</code> and following are my producer, consumer and topic configuration files respectively.</p>
  <pre><code>@Configuration
  public class KafkaProducerConfig {
  
      @Value(value = &quot;${spring.kafka.bootstrap-servers}&quot;)
      private String bootstrapAddress;
  </code></pre>
  <pre><code>@EnableKafka
  @Configuration
  public class KafkaConsumerConfig {
  
      @Value(value = &quot;${spring.kafka.bootstrap-servers}&quot;)
      private String bootstrapAddress;
  </code></pre>
  <pre><code>@Configuration
  public class KafkaTopicConfig {
  
      @Value(value = &quot;${spring.kafka.bootstrap-servers&quot;)
      private String bootstrapAddress;
  
      @Bean
      public KafkaAdmin kafkaAdmin() {
          Map&lt;String, Object&gt; configs = new HashMap&lt;&gt;();
          configs.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapAddress);
  ...
  </code></pre>
  <p>Am I doing something wrong or overlooking something?</p>
  <p><strong>Update:</strong></p>
  <p>The previous error is resolved. Although, now I'm facing the following issue.</p>
  <pre><code>2020-08-06 01:30:02.895  INFO 4090 --- [           main] o.a.kafka.common.utils.AppInfoParser     : Kafka version: 2.5.0
  2020-08-06 01:30:02.897  INFO 4090 --- [           main] o.a.kafka.common.utils.AppInfoParser     : Kafka commitId: 66563e712b0b9f84
  2020-08-06 01:30:02.897  INFO 4090 --- [           main] o.a.kafka.common.utils.AppInfoParser     : Kafka startTimeMs: 1596657602893
  2020-08-06 01:30:32.934 ERROR 4090 --- [           main] o.springframework.kafka.core.KafkaAdmin  : Could not configure topics
  
  org.springframework.kafka.KafkaException: Timed out waiting to get existing topics; nested exception is java.util.concurrent.TimeoutException
      at org.springframework.kafka.core.KafkaAdmin.lambda$checkPartitions$4(KafkaAdmin.java:254) [spring-kafka-2.5.2.RELEASE.jar:2.5.2.RELEASE]
      at java.base/java.util.HashMap.forEach(HashMap.java:1341) ~[na:na]
      at org.springframework.kafka.core.KafkaAdmin.checkPartitions(KafkaAdmin.java:233) [spring-kafka-2.5.2.RELEASE.jar:2.5.2.RELEASE]
      at org.springframework.kafka.core.KafkaAdmin.addTopicsIfNeeded(KafkaAdmin.java:219) [spring-kafka-2.5.2.RELEASE.jar:2.5.2.RELEASE]
      at org.springframework.kafka.core.KafkaAdmin.initialize(KafkaAdmin.java:189) [spring-kafka-2.5.2.RELEASE.jar:2.5.2.RELEASE]
      at org.springframework.kafka.core.KafkaAdmin.afterSingletonsInstantiated(KafkaAdmin.java:157) [spring-kafka-2.5.2.RELEASE.jar:2.5.2.RELEASE]
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:910) [spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) [spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) [spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
      at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
      at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
      at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
      at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.1.RELEASE.jar:2.3.1.RELEASE]
      at ai.kollie.kafka.KafkaApplication.main(KafkaApplication.java:19) [main/:na]
  Caused by: java.util.concurrent.TimeoutException: null
      at org.apache.kafka.common.internals.KafkaFutureImpl$SingleWaiter.await(KafkaFutureImpl.java:108) ~[kafka-clients-2.5.0.jar:na]
      at org.apache.kafka.common.internals.KafkaFutureImpl.get(KafkaFutureImpl.java:272) ~[kafka-clients-2.5.0.jar:na]
      at org.springframework.kafka.core.KafkaAdmin.lambda$checkPartitions$4(KafkaAdmin.java:236) [spring-kafka-2.5.2.RELEASE.jar:2.5.2.RELEASE]
      ... 16 common frames omitted
  </code></pre>
  <p>I have the created the topics that the application is using by creating <code>NewTopic</code> beans as follows:</p>
  <pre><code>@Bean
      public NewTopic userTestTopic() {
          return TopicBuilder.name(&quot;test-user&quot;)
                  .partitions(1)
                  .replicas(3)
                  .build();
      }
  
      @Bean
      public NewTopic employeeTestTopic() {
          return TopicBuilder.name(&quot;test-employee&quot;)
                  .partitions(1)
                  .replicas(3)
                  .build();
      }
  </code></pre>
  <p>Both the sides could communicate before despite of the previous error but cannot now. The terminal just lists out all the configs and stops, saying <code>Close timed out with 1 pending requests to coordinator, terminating client connections</code>. How do I resolve this?</p>