Campus food ordering system implemented three ways to demonstrate the trade-offs between synchronous, asynchronous, and streaming communication patterns.
comm_modes_lab_personal/
common/ Shared proto contracts, domain models, ID utilities
sync-grpc/ Part A — gRPC (synchronous, request-response)
async-rabbitmq/ Part B — RabbitMQ (async, event-driven)
streaming-kafka/ Part C — Kafka (streaming, log-based)
Each part has its own docker-compose.yml and is self-contained.
| Tool | Purpose | Install |
|---|---|---|
| Go 1.22+ | Language | https://go.dev/dl |
| Docker + Compose | Run all services | https://docs.docker.com/get-docker |
| buf | Proto compiler | brew install bufbuild/buf/buf or winget install bufbuild.buf |
# 1. Generate proto code (one-time)
make proto
cd common && go mod tidy && cd ..
# 2. Run a specific part
cd sync-grpc && docker compose up --build # Part A
cd async-rabbitmq && docker compose up --build # Part B
cd streaming-kafka && docker compose up --build # Part CStudent → OrderService → InventoryService → NotificationService → Student
What changes is how OrderService talks to Inventory and Notification:
| Part | Mechanism | Key property |
|---|---|---|
| A | gRPC call | Caller blocks until every step completes |
| B | RabbitMQ queue | OrderService returns immediately; rest happens in background |
| C | Kafka topic | Fully decoupled log; consumers can replay from any point |