registration-service
: handles the client request and register users in the DB, it produces tonew-user
topic.it listens to events that modify user's status by httpbroker-service
: listens to messages in every topic and redirects them to interested appsemail-service
: validate email request from broker and, if valid, produces toemail-validator
topic
Initiate Kafka with Zookeeper
I used kafka 2.11-0.11.0.1
but it should work any other higher versions,
you can download it from https://kafka.apache.org/downloads
Run Zookeeper
bin/zookeeper-server-start.sh config/zookeeper.properties
Run Kafka
bin/kafka-server-start.sh config/server.properties
Create topics
# New user topic
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic new-user
# Email Validation topic
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic email-validation
Clone the project
git clone https://github.com/EstebanDem/go-kafka-example
Go to the project directory
cd go-kafka-example
Run every microservice
cd broker-service
go run cmd/main.go
cd registration-service
go run cmd/main.go
cd email-service
go run cmd/main.go