Skip to content

NYcleaner/spark-example-kafka

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spark-example-kafka

This is a self-contained example project to illustrate using Spark Streaming with Kafka.

Firstly, build the JAR:

sbt assembly

Next, create your Kafka topic:

kafka-topics.sh --zookeeper localhost:2181 --create --topic wordcount --partitions 1 --replication-factor 1

Run the KafkaWordCountProducer to produce 10 messages per second with 100 words per message:

bin/KafkaWordCountProducer localhost:2181 wordcount 10 100

Last but not least, run the KafkaWordCount example:

bin/KafkaWordCount localhost:2181 KafkaWordCount wordcount 1

Check build.sbt to see how the dependencies are setup and workarounds for classpath collisions while building the assembly.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Scala 93.8%
  • Shell 6.2%