Not logged in. Login

Assignment 9: Simple Consumer

This isn't actually anything like what you need for the assignment, but it will consume and display messages:

Sample Kafka consumer, to verify that messages are coming in on the topic we expect.
import sys
from kafka import KafkaConsumer

topic = sys.argv[1]
consumer = KafkaConsumer(topic, bootstrap_servers=['node1.local', 'node2.local'])
for msg in consumer:
Updated Fri Aug. 25 2023, 15:55 by ggbaker.