A distributed microservices system for processing orders using event-driven architecture with Kafka.
The system consists of several microservices written in Go:
- Order Service: Handles order creation and management
- Inventory Service: Manages product inventory
- Shipper Service: Handles shipping logistics
- Notification Service: Sends notifications about order status
- Warehouse Service: Manages warehouse operations
- Error Service: Handles error tracking and monitoring
This diagram illustrates the general overview of how topics and services are connected.
The system uses Kafka topics for event-driven communication:
- order-received
- order-confirmed
- order-picked-packed
- order-notification
- order-error
- Language: Go
- Message Broker: Apache Kafka
- Containerization: Docker
- Configuration: Environment variables using caarlos0/env
- Monitoring: Prometheus
- API: RESTful APIs using Gin framework
- Docker and Docker Compose
- Go 1.23
- Kafka
-
Clone the repository
-
Setup your environment in
scripts/.env
COMPOSE_FILE=docker-compose.yml
PORT=29092- Start the environment
scripts/start-kafka.shNote that the environment is not persistent. The start-kafka.sh will execute setup-env.sh script to recreate the topics.
- Stopping the services
scripts/stop-kafka.shThat is it!
