Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-39

Use new Kafka 0.10 properties for listeners and advertised listeners

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 0.6
    • None
    • container-images
    • None

      It looks like Kafka 0.10 introduces these properties:

      • listeners
      • advertised.listeners

      and still supports the older (related?) properties:

      • advertised.host.name
      • advertised.port

      The default configuration file shipped with Kafka contains this fragment:

      # The address the socket server listens on. It will get the value returned from 
      # java.net.InetAddress.getCanonicalHostName() if not configured.
      #   FORMAT:
      #     listeners = security_protocol://host_name:port
      #   EXAMPLE:
      #     listeners = PLAINTEXT://your.host.name:9092
      #listeners=PLAINTEXT://:9092
      
      # Hostname and port the broker will advertise to producers and consumers. If not set, 
      # it uses the value for "listeners" if configured.  Otherwise, it will use the value
      # returned from java.net.InetAddress.getCanonicalHostName().
      #advertised.listeners=PLAINTEXT://your.host.name:9092
      

      and no longer contains:

      #advertised.host.name=<hostname routable by clients>
      #advertised.port=<port accessible by clients>
      

      We need to evaluate the differences between these new and older properties, and whether we should switch to using listeners and advertised.listeners rather than advertised.host.name and advertised.port. At the very least we should probably expose them so that the Docker container allows users to specify them.

      But because the advertised.host.name and advertised.port properties were removed from the default Kafka configuration file, some Docker images expect these properties to exist and are thus having a strange issue (see KAFKA-3568). I don't think the script in our Kafka Docker image suffers from this same problem, since our script modifies the property file by looking for an existing line for the target property (whether or not that line is commented out) and ensure the line is adjusted and no longer commented out. And, if no such line is not found, the script adds the property at the end. We should double check this, though.

            jpechane Jiri Pechanec
            rhauch Randall Hauch (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: