FernandoCagale / poc-kafka

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Golang - Kafka segmentio

Go Mod

  • Download dependencies
$ go mod download
  • Vendor local
$ go mod vendor

Configurable environment variables LOCAL

  • Rename file .envsample to .env
$ cp .envsample .env
Name Required Description
KAFKA_URL TRUE Kafka URL

Example

  • Running docker-compose up -d

  • Producer

$   go run producer/main.go --topic ecommerce --message info
  • Consumer group[order]
$   go run consumer/main.go --topic ecommerce --group order
$   message at topic:ecommerce partition:0 offset:2  = info
  • Consumer group[payment]
$   go run consumer/main.go --topic ecommerce --group payment
$   message at topic:ecommerce partition:0 offset:2  = info
  • Consumer group[notify]
$   go run consumer/main.go --topic ecommerce --group notify
$   message at topic:ecommerce partition:0 offset:2  = info

About


Languages

Language:Go 100.0%