advancedTop 100 Interview Questions

Why might Kafka work fine from the host but fail for external clients connecting to a Dockerized broker?

The classic cause is `KAFKA_ADVERTISED_LISTENERS` (or its older alias) being misconfigured — Kafka tells clients which address to reconnect to after the initial connection, and if that advertised address is only resolvable/reachable from inside the Docker network (e.g., the container's internal hostname), external clients can connect initially but fail on the follow-up metadata-driven reconnect.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to What's the difference between liveness and readiness probes for a Spring Boot app using Actuator?← Back to all Docker questions