Skip to main content
Version: 22.3

Start streaming

Before you can start streaming with Redpanda, install the software.

Streaming with rpk

rpk is a CLI tool you can use to work with your Redpanda nodes. Refer to rpk Commands for more information about rpk.

Here are some sample commands to produce and consume streams:

Create a topic called twitch_chat:

docker exec -it redpanda-1 \
rpk topic create twitch_chat --brokers=localhost:9092

Output:

TOPIC       STATUS
twitch_chat OK

Produce a message into the topic:

docker exec -it redpanda-1 \
rpk topic produce twitch_chat --brokers=localhost:9092

Enter a message:

Pandas are fabulous!

Output:

Produced to partition 0 at offset 0 with timestamp 1663282629789.

Click ctrl-d (or ctrl-z on Windows) to finish sending messages to the topic.

Consume one message from the topic:

docker exec -it redpanda-1 \
rpk topic consume twitch_chat --num 1 --brokers=localhost:9092

Each message is shown with its metadata, like this:

{
"topic": "twitch_chat",
"value": "Pandas are fabulous!",
"timestamp": 1663282629789,
"partition": 0,
"offset": 0
}

You can delete your topic by running:

docker exec -it redpanda-1 \
rpk topic delete twitch_chat --brokers=localhost:9092

Output:

TOPIC       STATUS
twitch_chat OK

Suggested reading