Created
January 17, 2015 15:59
-
-
Save dsbaars/6f0cbca136898da17ae0 to your computer and use it in GitHub Desktop.
Tweets Producer
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
from kafka import KafkaClient, SimpleProducer, SimpleConsumer | |
kafka = KafkaClient("bigdatavm:9092") | |
producer = SimpleProducer(kafka) | |
data = [] | |
f = open('part0.txt', 'rU') | |
lines = f.read().splitlines() | |
for line in lines: | |
producer.send_messages("worldcup", line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment