Apache Kafka® Quick Start

The guide below demonstrates how to quickly get started with Apache Kafka. You'll connect to a broker, create a topic, produce some messages, and consume them. Be sure to also check out the client code examples to learn more.

Confluent Cloud

The quickest way to get started with Apache Kafka is on Confluent Cloud, which provides it as a fully managed service. If you want to run Kafka locally, Docker is a good way to do so.

1. Sign up for Confluent Cloud

Head over to Confluent Cloud and sign up for an account if you don’t have one already. As a new user, you’ll get $200 of free usage each month for your first three months. If you're already signed up you can head straight to the log in page.

2. Create a Kafka Cluster

From the environments page click on Add Cluster and follow the prompts to launch a Basic cluster with a cloud provider and region of your choosing.

Quick Start for Confluent Cloud - Create Cluster Confluent Cloud - Create cluster

NOTE: You can also interact with Confluent Cloud from the command line using the Confluent Cloud CLI

3. Create a Topic

From the left-hand navigation click on Topics and then Create Topic.

Specify the name as quickstart, set the Number of partitions to 1, and then click on Create with defaults.

Quick Start for Confluent Cloud - Create Topic

4. Write messages to the topic

From the left-hand navigation click on Topics to see your new topic listed.

Quick Start for Confluent Cloud - Topic List

Click on the quickstart topic and then Messages.

Quick Start for Confluent Cloud - Topic Detail

Click Produce a new message to this topic, enter some JSON as the payload, and click on Produce.

Quick Start for Confluent Cloud - Topic Write

5. Read messages from the topic

Underneath the pane where you created the message, you will see the message appear:

Quick Start for Confluent Cloud - View Message

You can also view the messages from the Messages tab and enter an offset of 0 to view all messages from the beginning of the topic in a given partition.

Because the topic only has one partition, you will see all the messages.

Quick Start for Confluent Cloud - View Topic Message

What's Next

  • Build Apps
  • Build Pipelines
  • Operate
Build Apps
  • Select a value
  • Build Apps
  • Build Pipelines
  • Operate

Get Started with Kafka Clients

Write your first application using these full code examples in Java, Python, Go, .NET, Node.js, C/C++, REST, and further languages and CLIs.

Top 3 Courses for Application Developers

Confluent Cloud is a fully managed Apache Kafka service available on all three major clouds. Try it for free today