Real Time IoT data Simulator in Scala lang to feed kafka
"device_id": 1090011, "ip": "123.231.120.54","city": "C olombo", "latitude": 6.927100, "longitude": 79.861200, "t emp": 31, "timestamp”:1522503549000
https://github.com/OmalPerera/IoT-Data-Source-Simulator-Traffic-Data.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
You can add your own data structure & patterns. Code is direct forward
val citiesInNewYork = List("Elmira", "Oneonta", "Peekskill", "Albany", "Yonkers")