Categorygithub.com/Egorich42/go_kafka_restapi_example
module
0.0.0-20220530073809-d954ed63919f
Repository: https://github.com/egorich42/go_kafka_restapi_example.git
Documentation: pkg.go.dev

# README

Go-Kafka simple example

Example of basic connection Golang-app REST-API to Kafka. Analog of API for get coordinates from run tracker - longitude and lattitude

requirements

  • Go 1.18
  • Docker
  • docker-compose

How to run

  1. Run Kafka/Zookeeper
$ sudo docker-compose up --build
  1. Add necessary env-variables
export AppPort=10000 #port for application
export kafkaPort=9092
  1. Run app
$ go run main.go

Request example

curl -X POST http://localhost:8089/v1/coordinates -H 'Content-Type: application/json' -d '{"user_id":"d23432","lat":56.86,"lon":67.97}'

# Packages

No description provided by the author
No description provided by the author
No description provided by the author