OpsCanary
data infrakafkaPractitioner

Quickstart with Apache Kafka: Get Your Data Flowing

5 min read Apache Kafka DocsMay 24, 2026Reviewed for accuracy
Share
PractitionerHands-on experience recommended

Apache Kafka exists to handle the massive flow of data in real-time applications. It allows you to publish and subscribe to streams of records, making it essential for building data pipelines and streaming applications. Whether you're ingesting data from external systems or processing it in real-time, Kafka is designed to be durable and fault-tolerant, ensuring your data is always available.

Kafka operates through a straightforward mechanism. You can run it locally using scripts or a Docker image. A Kafka client communicates with Kafka brokers over the network, allowing you to write or read events. The brokers store these events in a fault-tolerant manner, ensuring they remain accessible for as long as you need. For example, you can create a topic with bin/kafka-topics.sh --create --topic quickstart-events --bootstrap-server localhost:9092, produce events using bin/kafka-console-producer.sh, and consume them with bin/kafka-console-consumer.sh.

In production, ensure your local environment has Java 17+ installed, as it's a prerequisite. Pay attention to the configuration parameters, such as plugin.path, which specifies the path to the connector jar in Kafka Connect. This is crucial when you're integrating with external systems. Be aware that the data is stored in the Kafka topic connect-test, and always monitor your Kafka cluster for performance and reliability as you scale up your usage.

Key takeaways

  • Run Kafka locally using scripts or Docker images for quick setup.
  • Create topics with `bin/kafka-topics.sh --create --topic quickstart-events --bootstrap-server localhost:9092`.
  • Ensure Java 17+ is installed in your environment to avoid compatibility issues.
  • Utilize Kafka Connect to ingest data from external systems seamlessly.
  • Monitor the `connect-test` topic for data integrity and availability.

Why it matters

In production, Kafka enables real-time data processing, which is critical for applications like analytics, monitoring, and event-driven architectures. Its durability and fault tolerance mean you can rely on it to handle large volumes of data without losing events.

Code examples

Bash
$ bin/kafka-topics.sh --create --topic quickstart-events --bootstrap-server localhost:9092
Bash
$ bin/kafka-console-producer.sh --topic quickstart-events --bootstrap-server localhost:9092>This is my first event>This is my second event
Bash
$ bin/kafka-console-consumer.sh --topic quickstart-events --from-beginning --bootstrap-server localhost:9092This is my first eventThis is my second event

When NOT to use this

The official docs don't call out specific anti-patterns here. Use your judgment based on your scale and requirements.

Want the complete reference?

Read official docs

Test what you just learned

Quiz questions written from this article

Take the quiz →
DigitalOcean Serverless InferenceSponsor

OpenAI & Anthropic-compatible inference API — no GPU provisioning needed. 55+ models, pay-per-token with no minimums. VPC + zero data retention by default.

Try Serverless Inference →

Get the daily digest

One email. 5 articles. Every morning.

No spam. Unsubscribe anytime.