Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions dataflow/flex-templates/kafka_to_bigquery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ Samples showing how to create and run an

## Before you begin

NOTE: These instructions used to use Bitnami version of Kafka, but due to a recent
untagging event on [Docker Hub](https://hub.docker.com/r/bitnami/kafka) for
all Bitnami images, these instructions have switched over to Apache Kafka images.
They are still pinned to a Zookeeper compatible
[version](https://kafka.apache.org/blog/2024/11/06/apache-kafka-3.9.0-release-announcement/)
of Kafka for now.

If you are not familiar with Dataflow Flex templates, please see the
[Streaming Beam SQL](../streaming-beam-sql/) sample first.

Expand Down Expand Up @@ -234,8 +241,8 @@ $ gcloud compute ssh kafka-vm --zone "$ZONE"
1. Create a Topic

```sh
docker run --rm --network host bitnami/kafka:3.4.0 \
/opt/bitnami/kafka/bin/kafka-topics.sh --bootstrap-server localhost:9092 \
docker run --rm --network host apache/kafka:3.9.1 \
/opt/kafka/bin/kafka-topics.sh --bootstrap-server localhost:9092 \
--create --topic <topic-name> --partitions 1 --replication-factor 1
```

Expand All @@ -250,8 +257,8 @@ Note: You can run this step either before starting the Dataflow template
they arrive).

```sh
docker run -i --rm --network host bitnami/kafka:3.4.0 \
/opt/bitnami/kafka/bin/kafka-console-producer.sh \
docker run -i --rm --network host apache/kafka:3.9.1 \
/opt/kafka/bin/kafka-console-producer.sh \
--bootstrap-server localhost:9092 --topic <topic-name>
```

Expand All @@ -262,16 +269,16 @@ This will print all messages from the beginning of the topic. Press Ctrl+C to
exit.

```sh
docker run -it --rm --network host bitnami/kafka:3.4.0 \
/opt/bitnami/kafka/bin/kafka-console-consumer.sh \
docker run -it --rm --network host apache/kafka:3.9.1 \
/opt/kafka/bin/kafka-console-consumer.sh \
--bootstrap-server localhost:9092 --topic <topic-name> --from-beginning
```

4. (Optional) Delete a Topic

```sh
docker run --rm --network host bitnami/kafka:3.4.0 \
/opt/bitnami/kafka/bin/kafka-topics.sh --bootstrap-server localhost:9092 \
docker run --rm --network host apache/kafka:3.9.1 \
/opt/kafka/bin/kafka-topics.sh --bootstrap-server localhost:9092 \
--delete --topic <topic-name>
```

Expand Down