This is a concurrent emoji broadcast system built using Kafka, Flask, and Spark in an event-driven architecture. This project enables real-time emoji broadcasting, processing, and aggregation.
.
├── app.py
├── emoji_consumer.py
├── emoji_producer.py
├── cluster_pub.py
├── main_pub.py
├── requirements.txt
├── spark.py
├── sub.py
└── index.html
app.py: Main Flask application with Kafka producer and consumer functionalitiesemoji_consumer.py: Kafka consumer script for receiving emoji messagesemoji_producer.py: Kafka producer script to send emoji messagescluster_pub.py: Kafka consumer and producer script for forwarding messages to cluster topicsmain_pub.py: Kafka consumer for listening to aggregated emoji messagesrequirements.txt: List of required Python dependenciesspark.py: Spark job for processing and aggregating emoji data from Kafkasub.py: Kafka consumer for listening to multiple cluster topicsindex.html: HTML webpage to display the emoji stream
- Kafka
- Zookeeper
- Spark
- Python 3.x
-
Start Zookeeper:
zookeeper-server-start.sh config/zookeeper.properties
-
Start Kafka:
kafka-server-start.sh config/server.properties
-
Run Flask Applications:
python app.py
-
Run Kafka Producer:
python emoji_producer.py
-
Run Spark Job:
python spark.py
-
Access Web Interface:
http://localhost:5000
- Send emoji messages through the web interface
- Watch real-time emoji processing and aggregation
- View aggregated emoji statistics
- Flask: Web framework
- Kafka: Message broker
- Spark: Distributed processing engine
- Zookeeper: Cluster coordination service
- Verify Kafka and Zookeeper are running
- Check terminal logs for errors
- Ensure Kafka is producing messages correctly