Real Time IoT data Simulator in Scala lang to feed kafka
git clone https://github.com/OmalPerera/realtime-data-streaming-simulator.git
You should configure following libararies in order to run this project.
- JAVA
- Scala (v2.11.11 Recommended) scala-lang.org installation guide
- Apache Kafka (0.10.2.0 Recommended) installation Guide
- Maven installation Guide for Mac
Here onwards navigate to your downloaded kafka directory in terminal & execute following commands. Each command should be execute on seperater terminal tabs.
sudo bin/zookeeper-server-start.sh config/zookeeper.properties
sudo bin/kafka-server-start.sh config/server.properties
sudo bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
sudo bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test
Now navigate to the directory where you cloned the project & execute following commands.
mvn clean package
java -jar dist/RDS-Simulator-1.0.jar
That's it! Now check the kafka Console Consumer
In any case of changing the defalut values to following, pass the command line arguments, which will override the default values.
brokers,topic,timeInterval
You can add your own data structure & patterns. Code is direct forward
val citiesInNewYork = List("Elmira", "Oneonta", "Peekskill", "Albany", "Yonkers")