title: Cannot connect to kafka through SpringBoot (docker) application
body: <p>Locally started the <strong>kafka</strong> and I wrote a sample <strong>Spring-boot producer</strong>. When I run this application it works fine. But when I start the application via docker container, I'm getting below logs "<strong>Connection to node 0 could not be established. Broker may not be available.</strong>"</p>
  
  <pre><code>2019-03-20 06:06:56.023  INFO 1 --- [  XNIO-2 task-1] o.a.k.c.u.AppInfoParser                  : Kafka version : 1.0.1
  2019-03-20 06:06:56.023  INFO 1 --- [  XNIO-2 task-1] o.a.k.c.u.AppInfoParser                  : Kafka commitId : c0518aa65f25317e
  2019-03-20 06:06:56.224  WARN 1 --- [ad | producer-1] o.a.k.c.NetworkClient                    : [Producer clientId=producer-1] Connection to node 0 could not be established. Broker may not be available.
  2019-03-20 06:06:56.263  WARN 1 --- [ad | producer-1] o.a.k.c.NetworkClient                    : [Producer clientId=producer-1] Connection to node 0 could not be established. Broker may not be available.
  2019-03-20 06:06:56.355  WARN 1 --- [ad | producer-1] o.a.k.c.NetworkClient                    : [Producer clientId=producer-1] Connection to node 0 could not be established. Broker may not be available.
  2019-03-20 06:06:56.594  WARN 1 --- [ad | producer-1] o.a.k.c.NetworkClient                    : [Producer clientId=producer-1] Connection to node 0 could not be established. Broker may not be available.
  2019-03-20 06:06:56.919  WARN 1 --- [ad | producer-1] o.a.k.c.NetworkClient                    : [Producer clientId=producer-1] Connection to node 0 could not be established. Broker may not be available.
  2019-03-20 06:06:57.877  WARN 1 --- [ad | producer-1] o.a.k.c.NetworkClient                    : [Producer clientId=producer-1] Connection to node 0 could not be established. Broker may not be available.
  </code></pre>
  
  <p>Please find the ProducerConfig values below based on the log</p>
  
  <pre><code>2019-03-20 06:06:55.953  INFO 1 --- [  XNIO-2 task-1] o.a.k.c.p.ProducerConfig                 : ProducerConfig values: 
      acks = 1
      batch.size = 16384
      bootstrap.servers = [192.168.0.64:9092]
      buffer.memory = 33554432
      client.id = 
      compression.type = none
      connections.max.idle.ms = 540000
      enable.idempotence = false
      interceptor.classes = null
      key.serializer = class org.apache.kafka.common.serialization.StringSerializer
      linger.ms = 0
      max.block.ms = 60000
      max.in.flight.requests.per.connection = 5
      max.request.size = 1048576
      metadata.max.age.ms = 300000
      metric.reporters = []
      metrics.num.samples = 2
      metrics.recording.level = INFO
      metrics.sample.window.ms = 30000
      partitioner.class = class org.apache.kafka.clients.producer.internals.DefaultPartitioner
      receive.buffer.bytes = 32768
      reconnect.backoff.max.ms = 1000
      reconnect.backoff.ms = 50
      request.timeout.ms = 30000
      retries = 0
      retry.backoff.ms = 100
      sasl.jaas.config = null
      sasl.kerberos.kinit.cmd = /usr/bin/kinit
      sasl.kerberos.min.time.before.relogin = 60000
      sasl.kerberos.service.name = null
      sasl.kerberos.ticket.renew.jitter = 0.05
      sasl.kerberos.ticket.renew.window.factor = 0.8
      sasl.mechanism = GSSAPI
      security.protocol = PLAINTEXT
      send.buffer.bytes = 131072
      ssl.cipher.suites = null
      ssl.enabled.protocols = [TLSv1.2, TLSv1.1, TLSv1]
      ssl.endpoint.identification.algorithm = null
      ssl.key.password = null
      ssl.keymanager.algorithm = SunX509
      ssl.keystore.location = null
      ssl.keystore.password = null
      ssl.keystore.type = JKS
      ssl.protocol = TLS
      ssl.provider = null
      ssl.secure.random.implementation = null
      ssl.trustmanager.algorithm = PKIX
      ssl.truststore.location = null
      ssl.truststore.password = null
      ssl.truststore.type = JKS
      transaction.timeout.ms = 60000
      transactional.id = null
      value.serializer = class org.springframework.kafka.support.serializer.JsonSerializer
  </code></pre>
  
  <p>My ProducerConfig as below</p>
  
  <pre><code>@Bean
  public Map&lt;String, Object&gt; producerConfigs() {
      Map&lt;String, Object&gt; props = new HashMap&lt;&gt;();
      props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "192.168.0.64:9092");
      props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
      props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, JsonSerializer.class);
      return props;
  }
  </code></pre>
  
  <p>Is there any additional configuration required when connecting through docker?</p>