Skip to content
Snippets Groups Projects
Name Last commit Last update
src/hello-kafka
README.md
docker-compose.yml
go.work

Just start kafka container using docker compose

> docker compose up --build

Shutdown of kafka container

> docker compose down

Run hello-kafka like a normal go program

> go run .

Output schould be similar to that:

2024/06/02 13:41:34 Topic 'hello-kafka' with 1 partitions successfully created

INFO[0000] Send message 'Hello Kafka!' to topic 'hello-kafka'

INFO[0001] Successfully send message 'Hello Kafka!' to topic 'hello-kafka'

INFO[0001] Start reading message from topic 'hello-kafka'

INFO[0001] Received message from topic 'hello-kafka' at partition 0, offset 0: Hello Kafka!