Skip to content

Latest commit

 

History

History
50 lines (32 loc) · 1.94 KB

File metadata and controls

50 lines (32 loc) · 1.94 KB

Realtime IoT Data Streaming Simulator

Real Time IoT data Simulator in Scala lang to feed kafka

Cloning the project

git clone https://github.com/OmalPerera/realtime-data-streaming-simulator.git

Configuring & Run the project

You should configure following libararies in order to run this project.


Here onwards navigate to your downloaded kafka directory in terminal & execute following commands. Each command should be execute on seperater terminal tabs.

Starting Zookeeper Server

sudo bin/zookeeper-server-start.sh config/zookeeper.properties

Starting Kafka Server

sudo bin/kafka-server-start.sh config/server.properties

Creating a topic

sudo bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test 

Running the consumer on console

sudo bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test

Run the dataGenerator

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

Customizations

Passing Arguments with .jar

In any case of changing the defalut values to following, pass the command line arguments, which will override the default values.

brokers,topic,timeInterval

Changing the data Structure

You can add your own data structure & patterns. Code is direct forward

val citiesInNewYork = List("Elmira", "Oneonta", "Peekskill", "Albany", "Yonkers")