- Consumer connect using Zookeeper
- Start Kafka and Zookeeper
$ docker-compose up
-
Start Producer
install dependencies
$ glide install
$ go build
$ ./producer
- Send Message to Kafka topic
curl -X POST \
http://localhost:3000/api/send \
-H 'content-type: application/json' \
-d '{
"from": "Wuriyanto",
"content":{
"header": "This is Message 2",
"body": "Hello Kafka"
}
}'
-
Start Consumer
install dependencies
$ glide install
$ go build
$ ./consumer