Created
February 15, 2018 20:34
-
-
Save ottomata/a131dc97344c70baa6ab33a08a0b457e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 KafkaConsumer | |
import json | |
from pprint import pprint | |
# To consume latest messages and auto-commit offsets | |
consumer = KafkaConsumer( | |
'eventlogging_TestSearchSatisfaction2', | |
group_id='otto1', | |
bootstrap_servers=['kafka1012:9092'] | |
) | |
for message in consumer: | |
e = json.loads(message.value) | |
if e['event']['action'] == 'click': | |
pprint(e['event']) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment