title: Kafka topic not created automatically on remote kafka after spring boot start(and create on local kafka server)
body: <p>1) I start kafka on my machine</p>
  
  <p>2) I start my spring boot server with config:</p>
  
  <pre><code>@Bean
  public NewTopic MyTopic() {
      return new NewTopic("my-topic", 5, (short) 1);
  }
  
  @Bean
  public ProducerFactory&lt;String, byte[]&gt; greetingProducerFactory() {
      Map&lt;String, Object&gt; configProps = new HashMap&lt;&gt;();
      configProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9092");
      configProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
      configProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class);
      return new DefaultKafkaProducerFactory&lt;&gt;(configProps);
  }
  
  @Bean
  public KafkaTemplate&lt;String, byte[]&gt; unpMessageKafkaTemplate() {
      return new KafkaTemplate&lt;&gt;(greetingProducerFactory());
  }
  </code></pre>
  
  <p>result - server is start successfully and create <code>my-topic</code> in kafka.</p>
  
  <p>But if I try do it with remote kafka on remote server - topic not create. </p>
  
  <p>and in log spring write:</p>
  
  <pre><code>12:35:09.880 [                  main] [INFO ]    o.a.k.clients.admin.AdminClientConfig: [] AdminClientConfig values: 
      bootstrap.servers = [localhost:9092]
  </code></pre>
  
  <p>If I add this bean to config:</p>
  
  <pre><code>@Bean
  public KafkaAdmin admin() {
      Map&lt;String, Object&gt; configs = new HashMap&lt;&gt;();
      configs.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, "remote_host:9092");
      return new KafkaAdmin(configs);
  }
  </code></pre>
  
  <p>topic create succesfully.</p>
  
  <p>1) Why it happens?</p>
  
  <p>2) Do I have to create  <code>KafkaAdmin</code> ? why for the local Kafka is not required?</p>
  
  <p><strong>EDDIT</strong></p>
  
  <p>My current config:</p>
  
  <pre><code>spring:
    kafka:
      bootstrap-servers: remote:9092
      producer:
        key-serializer: org.apache.kafka.common.serialization.StringDeserializer
        value-serializer: org.apache.kafka.common.serialization.ByteArraySerializer
  </code></pre>
  
  <p>and</p>
  
  <pre><code>@Configuration
  public class KafkaTopicConfig {
  
      @Value("${response.topics.topicName}")
      private String topicName;
  
      @Bean
      public NewTopic responseTopic() {
          return new NewTopic(topicName, 5, (short) 1);
      }
  
  }
  </code></pre>
  
  <p>After start I see:</p>
  
  <pre><code>bootstrap.servers = [remote:9092]
      client.id = 
      connections.max.idle.ms = 300000
      metadata.max.age.ms = 300000
      metric.reporters = []
      metrics.num.samples = 2
      metrics.recording.level = INFO
      metrics.sample.window.ms = 30000
      receive.buffer.bytes = 65536
  </code></pre>
  
  <p>...</p>
  
  <p>But topic not create</p>