I have been struggling to understand how the following two lines of configuration are interpreted.
KAFKA_CFG_LISTENERS: EXTERNAL_SAME_HOST://0.0.0.0:29092,INTERNAL://0.0.0.0:9092
KAFKA_CFG_ADVERTISED_LISTENERS: INTERNAL://kafka1:9092,EXTERNAL_SAME_HOST://localhost:29092
These lines come from a docker-compose.yml
file which configures Kafka environment variables for a Bitnami Kafka container.
I understand that for both environment variables, KAFKA_CFG_LISTENERS
and KAFKA_CFG_ADVERTISED_LISTENERS
that the names which follow are arbitrary.
For example, here INTERNAL
and EXTERNAL_SAME_HOST
are specified, but these could be literally any string so I don't understand how they have a meaningful interpretation to the Kafka process.
What is the difference between these two configuration variables (KAFKA_CFG_LISTENERS
, KAFKA_CFG_ADVERTISED_LISTENERS
) and how are they interpreted?