Implement Notification Service By Kafka Producer and Consumer.
P/s: Self-learning project for Kafka.
- Run Kafka with Docker
make docker-compose-up
Config:
- Broker: localhost:9092
- Topic: notification
- Consumer Group: kafka-notification-v1
- Create MySQL Database
- Go to config/local.yaml and configure your account.
- Run source code and migrate database
make dev
-
Go to notification database, table users and create 2 mock users.
-
Test Kafka Producer & Consumer
- Produce Message
POST: http://localhost:8080/message
{
"fromID": 1,
"toID": 2,
"message": "Hello World"
}