1. Frontend Producer
- Implemented a user interface where customers can add items to their cart and place orders
- Defined event schemas and payloads for each user action
- Published JSON messages to the Kafka topic using the Kafka producer API
2. Kafka Cluster Setup
- Launched a single-node Kafka broker on an EC2 instance
- Created the
orderstopic with replication factor 1 and partition count 3 - Validated connectivity by listing topics and inspecting message flow
3. Backend Consumer Dashboard
- Set up a Kafka consumer service to subscribe to the
orderstopic - Processed incoming order events and persisted them to a database
- Rendered a real-time dashboard showing all active orders
Ensure your consumer’s
group_id is unique per dashboard instance to balance load across multiple consumers.Summary Table
| Component | Responsibility | Key Command / API |
|---|---|---|
| Frontend Producer | Publishes order events to Kafka | producer.send() |
| Kafka Cluster (EC2) | Hosts broker, manages topics and partitions | kafka-topics.sh --create |
| Backend Consumer | Consumes events and updates the warehouse view | KafkaConsumer (Python) |