- Apache Kafka. Download the .tgz file and extract to home Directory.
- Twitter4j Jar. Download .zip file and extract to home directory.
- Dgraph. Download using curl.
- Docker. Download. (We wont be using docker.)
-
Zookeeper instance for Kafka.
Command:-(For linux and mac)
bin/zookeeper-server-start.sh config/zookeeper.properties
(For Windows)
bin\windows\zookeeper-server-start.bat config\zookeeper.properties
-
Kafka Broker instance.
Command:- (For Linux and Mac)
bin/kafka-server-start.sh config/server.properties
(For Windows)
bin\windows\kafka-server-start.bat config\server.properties
-
Dgraph.
Command:- (Linux and mac only)
dgraph
It is needed to create a topic for communication in the Publisher and Subscriber Model.
Command:- (Linux and Mac)
bin/kafka-topics.sh --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic topic-name
For Windows
bin\windows\kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic topic-name
Now that all the above services are running run the program in a terminal kafka_producer.java file in the kafka-files folder.
Command to Execute the file:-
javac -cp "/path/to/kafka/kafka_2.11-0.9.0.0/lib/*" kafka_producer.java
Command to run the file:-
java -cp "/path/to/kafka/kafka_2.11-0.9.0.0/lib/*":. kafka_producer
The above command should display the hashtags on the terminal.
Now in a new terminal run the kafka_consumer.java file in the kafka-files folder.
Command to Execute the file:-
javac -cp "/path/to/kafka/kafka_2.11-0.9.0.0/lib/*" kafka_consumer.java
Command to run the file:-
java -cp "/path/to/kafka/kafka_2.11-0.9.0.0/lib/*":. kafka_consumer
After running the Consumer You will get a string on the terminal which will be inserted into the Dgraph localhost client.
Since Dgraph instance is already up and running, Lets run the CsvToDgraph.java file from the csvtodgraph folder and get the query string in a file.
The file does the following:-
- Read data from the .csv file.
- Process them into a field object.
- Create the query string required for Dgraph.
At the end Copy the string and paste on a terminal and run.
Data is fetched from dgraph from the web page currently but soon i will change it form the web page to any programmetic method. Copy pasting the result to a .json file and using it in the javascript in d3.js.
- Deploy the Dgraph Database:- In Terminal go to the Event Driven Framework folder and run
dgraph -port 9090
- Deploy the web server:- In command prompt go to the folder and run
node HTTP_SERVER.js
- Open the Web Browser and open the following URL:-
Thank You