Difficulty: beginner
Estimated Time: 15 minutes
  • Educational Objective
  • What You Need To Know Before You Start
  • Working with Kafka
  • Scenario Contents

IMPORTANT: You need to do the steps in sequence in order for the state of the lesson's learning environment to be consistent. Otherwise, you'll get behaviors that might be confusing.

Educational Objective

The objective of this scenario is to show you how to install a Apache Kafka message broker in the Katacoda interactive learning environment. Also, the scenario will walk you through the steps of setting a topic and then publishing a message into that topic. Finally, you'll create a consumer to retrieve all the messages submitted to the topic.

What You Need To Know Before You Start

In order to get full benefit from the concepts and tasks presented in this scenario you need to have basic understanding of how to enter commands in the Katacoda interactive learning environment. Each step has commands that can be entered into the interactive terminal automatically by clicking on the command.

There is no need to type directly into the terminal window. Clicking on a command will automatically execute it.

Working with Kafka

Apache Kafka is a platform for persistent messaging at web scale. You use Kafka to create topics and publish messages and message streams into the given topic. Then you create consumers against the given topic to receive messages.

Apache Kafka Architecture

Scenario Contents

Step 1 - Setting Up Apache Kafka

Step 2 - Starting Kafka

Step 3 - Creating and Writing to a Topic

Step 4 - Getting Messages Using a Consumer

You've crossed the finish line!

In this scenario you learned:

  • How to set up Kafka
  • How to start up Zookeeper and Kafka
  • How to create a topic and publish messages into the topic we've created
  • How to consume messages from a topic

Setting Up Apache Kafka to Run on KataCoda

Step 1 of 4

Step 1 - Setting Up Apache Kafka

To download and install Kafka, do the following tasks.

Task 1: Download the code from the mirror site:

curl -O https://us.mirrors.quenda.co/apache/kafka/2.5.0/kafka_2.12-2.5.0.tgz

Task 2: Unzip the Tar Ball

tar -xzf kafka_2.12-2.5.0.tgz

Task 3: Go into the Kafka directory

cd kafka_2.12-2.5.0