title: Kafka producer error "1 partitions have leader brokers without a matching listener"
body: <p>First time working with Kafka and Docker-compose. I'm trying to publish a message to Kafka but I get an error (look below). What is the issue?</p>
  <blockquote>
  <p>2020-07-21 16:37:40,274 WARN  [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient$DefaultMetadataUpdater: [Producer clientId=producer-1] 1 partitions have leader brokers without a matching listener, including [demo-topic-0]</p>
  </blockquote>
  <p>Here is my docker-compose.yml:</p>
  <pre><code>version: '3'
  
  services:
    zookeeper:
      image: wurstmeister/zookeeper
      ports:
        - &quot;2181:2181&quot;
    kafka:
      image: wurstmeister/kafka
      links:
        - zookeeper:zk
      ports:
        - &quot;9092:9092&quot;
      expose:
        - &quot;9093&quot;
      environment:
        KAFKA_ZOOKEEPER_CONNECT: zk:2181
        KAFKA_MESSAGE_MAX_BYTES: 2000000
        KAFKA_CREATE_TOPICS: &quot;demo-topic:1:1&quot;
        KAFKA_BROKER_ID: 1
        KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9093,PLAINTEXT_HOST://localhost:9092
        KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
        KAFKA_LISTENERS: PLAINTEXT://kafka:9093,PLAINTEXT_HOST://localhost:9092
        KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
        KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
      volumes:
        - /var/run/docker.sock:/var/run/docker.sock
      depends_on:
        - zookeeper
  
    player-service-ci:
      image: player/player-service:latest
      container_name: player-service-ci
      restart: unless-stopped
      volumes:
        - /tmp/app/logs:/logs
      environment:
        - &quot;JAVA_OPTS=-Xmx256m -Xms128m&quot;
        - &quot;spring.profiles.active=ci&quot;
        - &quot;LOGS_FILENAME=player-service-logger-ci&quot;
        - &quot;SPRING_KAFKA_BOOTSTRAPSERVERS=kafka:9093&quot;
      ports:
        - 17500:17500
  
  networks:
    default:
      external:
        name: ci
  </code></pre>