This repository created to show the example for using Avro for serialization & Kafka for publish-subscribe messaging with (Golang) as Simple Producer and Consumer
Download the latest Kafka version from this link Kafka Download Page and choose the binary downloads.
bin/zookeeper-server-start.sh config/zookeeper.properties
bin/kafka-server-start.sh config/server.properties
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic simple-avro-kafka-golang
bin/kafka-topics.sh --list --zookeeper localhost:2181
bin/kafka-console-producer.sh --broker-list localhost:9092 --topic simple-avro-kafka-golang
bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic simple-avro-kafka-golang --from-beginning
Build
$ docker-compose build
Run
$ docker-compose up
Stop
$ docker-compose down
config-sample.json
to config.json
and change the value based on your config.localhost:9092
config-sample.json
to config.json
and change the value based on your config.localhost:9092
Make sure you already have POSTMAN
{
"role": "user",
"data": {
"id": 4,
"name": "Dekisugi"
}
}
Version | Tag | Published |
---|---|---|
v0.0.0-20200306074333-d2cf7220a413 | 2yrs ago |