Back to Port Numbers

9092 Kafka TCP Flagship

Reference for TCP port 9092, commonly associated with Kafka.

What it's for

Port 9092 is the default port for Apache Kafka, the distributed event-streaming platform built around an append-only, partitioned log rather than a traditional queue. Producers write events to Kafka "topics," and any number of independent consumers can read those events at their own pace — crucially, reading a message doesn't remove it, so multiple consumer groups can process the same stream of events independently.

This log-based model is what makes Kafka the backbone of choice for high-throughput event pipelines, activity tracking, log aggregation, and architectures where you want to replay historical events (rebuilding a derived data store from scratch, for example) rather than just processing each message once and discarding it.

Protocol basics

  • Protocol: TCP, for reliable high-throughput delivery of the underlying log data.
  • Partitioned, ordered log. Each topic is split into partitions, and within a partition, message order is guaranteed — this partitioning is also Kafka's mechanism for parallelism, since different partitions can be produced to and consumed from independently.
  • Retention-based, not delete-on-read. Unlike a traditional queue, Kafka retains messages for a configured period (or size) regardless of whether they've been consumed, enabling replay and multiple independent consumer groups.
  • Broker-based cluster architecture. A Kafka cluster consists of multiple broker nodes, each handling a subset of partitions, coordinated (in modern Kafka) via KRaft consensus or (in older setups) via a separate ZooKeeper ensemble on port 2181.

Security considerations

  • Port 9092 should not be exposed to the public internet — Kafka clusters belong on a private network, reachable only by producer/consumer applications and internal tooling.
  • Enable SASL authentication and TLS encryption for any non-trivial deployment — Kafka doesn't require authentication out of the box in a default local setup, which is fine for development but not appropriate for anything handling real traffic.
  • Configure ACLs (access control lists) to scope which principals can produce to or consume from specific topics, rather than granting broad cluster-wide access to every service.
  • Plan retention policy deliberately — since Kafka retains data by design, sensitive information written to a topic persists for as long as the retention window specifies, which has real data-governance implications distinct from a traditional "process and delete" queue.

Troubleshooting

"Connection to node -1 could not be established":

  • Broker isn't running, wrong port/hostname configured, or a firewall is blocking access between the client and broker

Producer succeeds but consumer sees nothing:

  • Check that the consumer is subscribed to the correct topic name and, if using consumer groups, that the group's offset isn't already past the messages you expect to see (a common gotcha when testing — new consumer groups typically start from "latest" by default, missing anything published before they connected)

Consumer lag growing continuously:

  • The consumer isn't processing fast enough to keep up with the producer's rate — this usually calls for either optimizing consumer processing or adding more consumer instances within the same consumer group to parallelize across partitions

Broker unreachable after networking change (cloud environment):

  • Kafka brokers advertise a specific hostname/IP to clients (the advertised.listeners config) — if this doesn't match how clients actually need to reach the broker (e.g., through a load balancer or NAT), clients will fail to connect even if the initial bootstrap connection succeeds

Comparison / FAQ

Port Protocol Key difference from 9092 (Kafka)
5672 (AMQP/RabbitMQ) TCP Traditional message queue semantics (message removed once consumed) rather than a retained, replayable log
2181 (ZooKeeper) TCP Used by older Kafka versions for cluster coordination; newer Kafka (KRaft mode) removes this dependency entirely

Do I need ZooKeeper to run Kafka?

Not with modern Kafka versions — KRaft mode (Kafka Raft) removes the ZooKeeper dependency entirely, handling cluster metadata and consensus within Kafka itself. Older deployments and some existing documentation still reference ZooKeeper on port 2181 since it was required in earlier Kafka versions.

Why can multiple consumers read the same Kafka messages, unlike a typical queue?

Because Kafka doesn't delete messages on read — it retains them in the log according to your retention policy, and each consumer group independently tracks its own read position (offset). This is fundamentally different from a traditional queue where a message is removed once a consumer processes it.

What causes consumer lag in Kafka?

Consumer lag means the consumer's current offset is behind the latest message produced — usually because the consumer can't process messages as fast as they're being produced. Scaling out consumers within the same consumer group (up to the number of partitions) is the standard fix.

Is Kafka overkill for a simple background job queue?

Often, yes — if you just need "process this job once, then discard it" semantics without replay requirements, a simpler queue like RabbitMQ or a database-backed queue is usually less operational overhead than running and maintaining a Kafka cluster.