diff --git a/templates/server.properties.j2 b/templates/server.properties.j2 index 7d69c94..f49fd73 100644 --- a/templates/server.properties.j2 +++ b/templates/server.properties.j2 @@ -24,7 +24,11 @@ host.name={{kafka_listen_address}} # Hostname the broker will advertise to producers and consumers. If not set, it uses the # value for "host.name" if configured. Otherwise, it will use the value returned from # java.net.InetAddress.getCanonicalHostName(). +{% if kafka_advertised_host_name is defined %} +advertised.host.name={{kafka_advertised_host_name}} +{% else %} #advertised.host.name= +{% endif %} # The port to publish to ZooKeeper for clients to use. If this is not set, # it will publish the same port that the broker binds to.