Last active
August 26, 2016 20:56
-
-
Save thomasdziedzic/8a6cc222ba837012c266d48e61fa06bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.spark.streaming._ | |
import org.apache.spark.streaming.kafka010._ | |
val kafkaParams = Map("metadata.broker.list" -> "localhost:9092") | |
val topics = Set("test") | |
val streamingContext = new StreamingContext(sc, Seconds(1)) | |
val kafkaStream = KafkaUtils.createDirectStream(streamingContext, kafkaParams, topics) | |
kafkaStream.print() | |
streamingContext.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment