data_export_kafka

command
v1.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 8 Imported by: 0

README

Kafka exporter example

This example contains everything you need to export the usage of your flag to Kafka.

How to setup the example

All commands should be run in the root level of the repository.

  1. Start a kafka server by running:
docker-compose -f examples/data_export_kafka/docker-compose.yml up
  1. Create a topic in Kafka:
docker exec $(docker ps | grep cp-kafka |  awk '{print $1}') kafka-topics --create --topic go-feature-flag-events --bootstrap-server localhost:9092
  1. Update dependencies:
make vendor
  1. Run the example application:
go run ./examples/data_export_kafka/main.go

If you check the logs, you should see the events being sent 1 by 1 to kafka.

  1. Read the items in the topic:
docker exec $(docker ps | grep cp-kafka |  awk '{print $1}')  kafka-console-consumer --bootstrap-server localhost:9092 --topic go-feature-flag-events --from-beginning

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL