/kafka-notification-service-anduckhmt146

Implement Notification Service with Kafka Consumer, Kafka Producer.

Primary LanguageGo

Kafka Notification Service

Implement Notification Service By Kafka Producer and Consumer.

P/s: Self-learning project for Kafka.

Run Local

  1. Run Kafka with Docker
    make docker-compose-up

Config:

  • Broker: localhost:9092
  • Topic: notification
  • Consumer Group: kafka-notification-v1
  1. Create MySQL Database
  • Go to config/local.yaml and configure your account.
  1. Run source code and migrate database
    make dev
  1. Go to notification database, table users and create 2 mock users.

  2. Test Kafka Producer & Consumer

  • Produce Message
    POST: http://localhost:8080/message
{
    "fromID": 1,
    "toID": 2,
    "message": "Hello World"
}
  • Consume Messsage

    Kafka Consumer