Skip to content

This project can be used as a tutorial showing to to use twiiter4j of twitter to stream. Use Apache Kafka as a producer, and Apache Spark as a consumer

Notifications You must be signed in to change notification settings

jodth07/twitter-kafka-spark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

twitter-kafka-spark

This project is about setting up kafka and spark for streaming twitter feeds.

it contains streaming the twitter feeds, kafka, and spark independently, and linked via main.

To run TwitterStream

in order to run the twitter stream, a twitter developer account is required. From the developer account, you need to have an app created with the app. Information on how to create an app with twitter can be found at:
https://docs.inboundnow.com/guide/create-twitter-application/

To run KafkaProducer

running this project for Kafka and Spark requires to have zookeeper and kafka servers running.
Below are the steps to run those.

  1. cd into your kafka directory
    in mac (installed via Brew) cd /usr/hdp/current/kafka-broker/

in linux :
cd /opt/kafka/<kafka_version>

else : wherever you install it

  1. Run zookeeper server
    ./bin/zookeeper-server-start libexec/config/zookeeper.properties

  2. Run kafka server
    ./bin/kafka-server-start libexec/config/server.properties

  3. Create topics
    ./bin/kafka-topics --create --zookeeper localhost:2181 --partitions 1 --replication-factor 1 --topic colors

  4. Create Producers
    kafka-console-producer --broker-list localhost:9092 --topic colors

  5. Create Consumers
    kafka-console-consumer --bootstrap-server localhost:9092 --topic colors

To Run SparkConsumer

  1. Make sure that the build.sbt has the appropriate dependencies.

About

This project can be used as a tutorial showing to to use twiiter4j of twitter to stream. Use Apache Kafka as a producer, and Apache Spark as a consumer

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages