advancedPackaging & Running Standalone

What's a common misconfiguration when running a packaged Kafka consumer app standalone (outside Docker Compose) for the first time?

Pointing `bootstrap.servers` at `localhost:9092` when the app is actually running in an environment where Kafka is reachable at a different hostname/port (e.g. a Docker service name or a remote broker) — this is one of the most common 'works on my machine but not elsewhere' Kafka connectivity bugs, since the client fails silently-ish with connection retries rather than a clear error.

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 Why does a Dockerized Kafka consumer service need explicit health checks defined in its Dockerfile/Compose config?← Back to all Kafka & Microservices questions