Spring Boot containers can not connect to the Kafka container Spring Boot containers can not connect to the Kafka container docker docker

Spring Boot containers can not connect to the Kafka container


You need to advertise your Kafka broker as kafka, which is the effective hostname for all linking containers (i.e. the hostname that the client needs to connect to from the Kafka protocol perspective, and so kafka:9092 is correct, not 0.0.0.0):

kafka:  ...  environment:    KAFKA_ADVERTISED_HOST_NAME: kafka